-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
api: automlIssues related to the AutoML API.Issues related to the AutoML API.api: bigquerydatatransferIssues related to the BigQuery Data Transfer Service API.Issues related to the BigQuery Data Transfer Service API.api: bigtableIssues related to the Bigtable API.Issues related to the Bigtable API.api: clouderrorreportingIssues related to the Error Reporting API.Issues related to the Error Reporting API.api: cloudiotIssues related to the IoT Core API.Issues related to the IoT Core API.api: cloudtasksIssues related to the Cloud Tasks API.Issues related to the Cloud Tasks API.api: cloudtraceIssues related to the Cloud Trace API.Issues related to the Cloud Trace API.api: containerIssues related to the Kubernetes Engine API API.Issues related to the Kubernetes Engine API API.api: dataprocIssues related to the Dataproc API.Issues related to the Dataproc API.api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.api: dlpIssues related to the Sensitive Data Protection API.Issues related to the Sensitive Data Protection API.api: firestoreIssues related to the Firestore API.Issues related to the Firestore API.api: languageIssues related to the Cloud Natural Language API API.Issues related to the Cloud Natural Language API API.api: loggingIssues related to the Cloud Logging API.Issues related to the Cloud Logging API.api: monitoringIssues related to the Cloud Monitoring API.Issues related to the Cloud Monitoring API.api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.api: redisIssues related to the Memorystore for Redis API.Issues related to the Memorystore for Redis API.api: spannerIssues related to the Spanner API.Issues related to the Spanner API.api: speechIssues related to the Speech-to-Text API.Issues related to the Speech-to-Text API.api: texttospeechIssues related to the Text-to-Speech API.Issues related to the Text-to-Speech API.api: videointelligenceIssues related to the Video Intelligence API API.Issues related to the Video Intelligence API API.api: visionIssues related to the Cloud Vision API.Issues related to the Cloud Vision API.codegenpriority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
tl;dr
The GAPIC-generated class constructors listed below scribble on the fallback google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO instance, rather than creating their own copy.
@crwilcox Can you please link in the related codegen issue?
Analysis
The pattern is that these client classes take an optional client_info parameter: if not passed, they use the DEFAULT_CLIENT_INFO instance. In either case, they then assign over its gapic_version attribute:
if client_info is None:
client_info = (
google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO)
client_info.gapic_version = _GAPIC_LIBRARY_VERSION
self._client_info = client_infoI am certain that it is inappropriate to scribble on the global DEFAULT_CLIENT_INFO instance. Rather they should be creating a new google.api_core.gapic.client_info.ClientInfo instance. I
believe that if the user passes in a non-None client_info, these clients should not scribble on it. E.g.:
if client_info is None:
client_info = google.api_core.gapic_v1.client_info.ClientInfo(
gapic_version = _GAPIC_LIBRARY_VERSION,
)
self._client_info = client_infoOffending Classes
google.cloud.automl_v1beta1.gapic.auto_ml_client.AutoMlClientgoogle.cloud.automl_v1beta1.gapic.prediction_service_client.PredictionServiceClientgoogle.cloud.bigquery_datatransfer_v1.gapic.data_transfer_service_client.DataTransferServiceClientgoogle.cloud.bigtable_admin_v2.gapic.bigtable_instance_admin_client.BigtableInstanceAdminClientgoogle.cloud.bigtable_admin_v2.gapic.bigtable_table_admin_client.BigtableTableAdminClientgoogle.cloud.bigtable_v2.gapic.bigtable_client.BigtableClientgoogle.cloud.container_v1.gapic.cluster_manager_client.ClusterManagerClientgoogle.cloud.dataproc_v1.gapic.cluster_controller_client.ClusterControllerClientgoogle.cloud.dataproc_v1.gapic.job_controller_client.JobControllerClientgoogle.cloud.datastore_v1.gapic.datastore_client.DatastoreClientgoogle.cloud.dlp_v2.gapic.dlp_service_client.DlpServiceClientgoogle.cloud.errorreporting_v1beta1.gapic.error_group_service_client.ErrorGroupServiceClientgoogle.cloud.errorreporting_v1beta1.gapic.error_stats_service_client.ErrorStatsServiceClientgoogle.cloud.errorreporting_v1beta1.gapic.report_errors_service_client.ReportErrorsServiceClientgoogle.cloud.firestore_v1beta1.gapic.firestore_client.FirestoreClientgoogle.cloud.iot_v1.gapic.device_manager_client.DeviceManagerClientgoogle.cloud.kms_v1.gapic.key_management_service_client.KeyManagementServiceClientgoogle.cloud.language_v1.gapic.language_service_client.LanguageServiceClientgoogle.cloud.language_v1beta2.gapic.language_service_client.LanguageServiceClientgoogle.cloud.logging_v2.gapic.config_service_v2_client.ConfigServiceV2Clientgoogle.cloud.logging_v2.gapic.logging_service_v2_client.LoggingServiceV2Clientgoogle.cloud.logging_v2.gapic.metrics_service_v2_client.MetricsServiceV2Clientgoogle.cloud.monitoring_v3.gapic.alert_policy_service_client.AlertPolicyServiceClientgoogle.cloud.monitoring_v3.gapic.group_service_client.GroupServiceClientgoogle.cloud.monitoring_v3.gapic.metric_service_client.MetricServiceClientgoogle.cloud.monitoring_v3.gapic.notification_channel_service_client.NotificationChannelServiceClientgoogle.cloud.monitoring_v3.gapic.uptime_check_service_client.UptimeCheckServiceClientgoogle.cloud.oslogin_v1.gapic.os_login_service_client.OsLoginServiceClientgoogle.cloud.pubsub_v1.gapic.publisher_client.PublisherClientgoogle.cloud.pubsub_v1.gapic.subscriber_client.SubscriberClientgoogle.cloud.redis_v1beta1.gapic.cloud_redis_client.CloudRedisClientgoogle.cloud.spanner_admin_database_v1.gapic.database_admin_client.DatabaseAdminClientgoogle.cloud.spanner_admin_instance_v1.gapic.instance_admin_client.InstanceAdminClientgoogle.cloud.spanner_v1.gapic.spanner_client.SpannerClientgoogle.cloud.speech_v1.gapic.speech_client.SpeechClientgoogle.cloud.speech_v1p1beta1.gapic.speech_client.SpeechClientgoogle.cloud.tasks_v2beta2.gapic.cloud_tasks_client.CloudTasksClientgoogle.cloud.texttospeech_v1.gapic.text_to_speech_client.TextToSpeechClientgoogle.cloud.texttospeech_v1beta1.gapic.text_to_speech_client.TextToSpeechClientgoogle.cloud.trace_v1.gapic.trace_service_client.TraceServiceClientgoogle.cloud.trace_v2.gapic.trace_service_client.TraceServiceClientgoogle.cloud.videointelligence_v1.gapic.video_intelligence_service_client.VideoIntelligenceServiceClientgoogle.cloud.videointelligence_v1beta1.gapic.video_intelligence_service_client.VideoIntelligenceServiceClientgoogle.cloud.videointelligence_v1beta2.gapic.video_intelligence_service_client.VideoIntelligenceServiceClientgoogle.cloud.videointelligence_v1p1beta1.gapic.video_intelligence_service_client.VideoIntelligenceServiceClientgoogle.cloud.vision_v1.gapic.image_annotator_client.ImageAnnotatorClientgoogle.cloud.vision_v1p1beta1.gapic.image_annotator_client.ImageAnnotatorClientgoogle.cloud.vision_v1p2beta1.gapic.image_annotator_client.ImageAnnotatorClientgoogle.cloud.vision_v1p3beta1.gapic.image_annotator_client.ImageAnnotatorClientgoogle.cloud.vision_v1p3beta1.gapic.product_search_client.ProducSearchClientgoogle.cloud.websecurityscanner_v1alpha.gapic.web_security_scanner_client.WebSecurityScannerClient
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: automlIssues related to the AutoML API.Issues related to the AutoML API.api: bigquerydatatransferIssues related to the BigQuery Data Transfer Service API.Issues related to the BigQuery Data Transfer Service API.api: bigtableIssues related to the Bigtable API.Issues related to the Bigtable API.api: clouderrorreportingIssues related to the Error Reporting API.Issues related to the Error Reporting API.api: cloudiotIssues related to the IoT Core API.Issues related to the IoT Core API.api: cloudtasksIssues related to the Cloud Tasks API.Issues related to the Cloud Tasks API.api: cloudtraceIssues related to the Cloud Trace API.Issues related to the Cloud Trace API.api: containerIssues related to the Kubernetes Engine API API.Issues related to the Kubernetes Engine API API.api: dataprocIssues related to the Dataproc API.Issues related to the Dataproc API.api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.api: dlpIssues related to the Sensitive Data Protection API.Issues related to the Sensitive Data Protection API.api: firestoreIssues related to the Firestore API.Issues related to the Firestore API.api: languageIssues related to the Cloud Natural Language API API.Issues related to the Cloud Natural Language API API.api: loggingIssues related to the Cloud Logging API.Issues related to the Cloud Logging API.api: monitoringIssues related to the Cloud Monitoring API.Issues related to the Cloud Monitoring API.api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.api: redisIssues related to the Memorystore for Redis API.Issues related to the Memorystore for Redis API.api: spannerIssues related to the Spanner API.Issues related to the Spanner API.api: speechIssues related to the Speech-to-Text API.Issues related to the Speech-to-Text API.api: texttospeechIssues related to the Text-to-Speech API.Issues related to the Text-to-Speech API.api: videointelligenceIssues related to the Video Intelligence API API.Issues related to the Video Intelligence API API.api: visionIssues related to the Cloud Vision API.Issues related to the Cloud Vision API.codegenpriority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.