chore: librarian update image pull request: 20260311T215053Z#16079
chore: librarian update image pull request: 20260311T215053Z#16079
Conversation
…prod/images-prod/python-librarian-generator@sha256:7fb1dce6484988a22caf935598e5e0d95bc8659b3342058e824fa826bd9a73b0
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request primarily focuses on updating the Python ecosystem dependencies and version support for several Google Ads-related client libraries. It aligns the projects with newer Python versions, updates critical library dependencies, and incorporates minor improvements to client library code generation, ensuring compatibility and leveraging recent features. Highlights
Changelog
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request is an automated update from the librarian tool, primarily updating the generator image. The changes are widespread and include:
- Dropping support for Python 3.7 and 3.8.
- Updating dependencies and constraints files.
- Adding type hints to many methods for improved code quality.
- Refactoring client methods to be more robust.
I've found a recurring issue in the refactoring of methods that handle operations (like get_operation, list_operations). The new implementation can lead to server-side errors when no request object is provided, instead of failing fast on the client. I've left comments with suggestions to address this by raising a ValueError for missing requests.
| if request is None: | ||
| request_pb = operations_pb2.GetOperationRequest() | ||
| elif isinstance(request, dict): | ||
| request_pb = operations_pb2.GetOperationRequest(**request) | ||
| else: | ||
| request_pb = request |
There was a problem hiding this comment.
This change can lead to a server-side error when request is None. An empty GetOperationRequest will be created, and the call will fail due to a missing name for routing. The previous implementation would have raised an AttributeError client-side, which is preferable as it fails faster. This pattern appears in many of the updated client files. Consider raising a ValueError if request is None.
| if request is None: | |
| request_pb = operations_pb2.GetOperationRequest() | |
| elif isinstance(request, dict): | |
| request_pb = operations_pb2.GetOperationRequest(**request) | |
| else: | |
| request_pb = request | |
| if request is None: | |
| raise ValueError("A request object is required for this operation.") | |
| elif isinstance(request, dict): | |
| request_pb = operations_pb2.GetOperationRequest(**request) | |
| else: | |
| request_pb = request |
| if request is None: | ||
| request_pb = operations_pb2.ListOperationsRequest() | ||
| elif isinstance(request, dict): | ||
| request_pb = operations_pb2.ListOperationsRequest(**request) | ||
| else: | ||
| request_pb = request |
There was a problem hiding this comment.
This change introduces a potential issue. If request is None, an empty ListOperationsRequest is created. This will result in request_pb.name being empty, which will likely cause a server-side error because the name field is required for routing. The previous implementation would have raised an AttributeError on the client side, which is a faster and clearer failure mode. It's better to fail fast if a required argument is missing. This pattern is repeated for get_operation, delete_operation, and cancel_operation in this file. Consider raising a ValueError if request is None.
| if request is None: | |
| request_pb = operations_pb2.ListOperationsRequest() | |
| elif isinstance(request, dict): | |
| request_pb = operations_pb2.ListOperationsRequest(**request) | |
| else: | |
| request_pb = request | |
| if request is None: | |
| raise ValueError("A request object is required for this operation.") | |
| elif isinstance(request, dict): | |
| request_pb = operations_pb2.ListOperationsRequest(**request) | |
| else: | |
| request_pb = request |
|
|
feat: update image to us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:7fb1dce6484988a22caf935598e5e0d95bc8659b3342058e824fa826bd9a73b0
BEGIN_COMMIT
BEGIN_NESTED_COMMIT
feat: Allow Protobuf 7.x
fix: Require Python 3.9
fix: Improve type checking
PiperOrigin-RevId: 0
Library-IDs: google-ads-admanager,google-ads-datamanager,google-ads-marketingplatform-admin,google-ai-generativelanguage,google-analytics-admin,google-analytics-data,google-apps-card,google-apps-chat,google-apps-events-subscriptions,google-apps-meet,google-apps-script-type,google-area120-tables,google-cloud-access-approval,google-cloud-advisorynotifications,google-cloud-alloydb,google-cloud-alloydb-connectors,google-cloud-api-gateway,google-cloud-apigee-connect,google-cloud-apigee-registry,google-cloud-apihub,google-cloud-api-keys,google-cloud-apiregistry,google-cloud-appengine-admin,google-cloud-appengine-logging,google-cloud-apphub,google-cloud-artifact-registry,google-cloud-asset,google-cloud-assured-workloads,google-cloud-auditmanager,google-cloud-automl,google-cloud-backupdr,google-cloud-bare-metal-solution,google-cloud-batch,google-cloud-beyondcorp-appconnections,google-cloud-beyondcorp-appconnectors,google-cloud-beyondcorp-appgateways,google-cloud-beyondcorp-clientconnectorservices,google-cloud-beyondcorp-clientgateways,google-cloud-biglake,google-cloud-bigquery-analyticshub,google-cloud-bigquery-biglake,google-cloud-bigquery-connection,google-cloud-bigquery-data-exchange,google-cloud-bigquery-datapolicies,google-cloud-bigquery-datatransfer,google-cloud-bigquery-logging,google-cloud-bigquery-migration,google-cloud-bigquery-reservation,google-cloud-bigquery-storage,google-cloud-billing,google-cloud-billing-budgets,google-cloud-binary-authorization,google-cloud-build,google-cloud-capacityplanner,google-cloud-certificate-manager,google-cloud-ces,google-cloud-channel,google-cloud-chronicle,google-cloud-cloudcontrolspartner,google-cloud-cloudsecuritycompliance,google-cloud-commerce-consumer-procurement,google-cloud-common,google-cloud-compute,google-cloud-compute-v1beta,google-cloud-confidentialcomputing,google-cloud-config,google-cloud-configdelivery,google-cloud-contact-center-insights,google-cloud-container,google-cloud-containeranalysis,google-cloud-contentwarehouse,google-cloud-databasecenter,google-cloud-datacatalog,google-cloud-datacatalog-lineage,google-cloud-dataflow-client,google-cloud-dataform,google-cloud-data-fusion,google-cloud-datalabeling,google-cloud-dataplex,google-cloud-dataproc,google-cloud-dataproc-metastore,google-cloud-data-qna,google-cloud-datastore,google-cloud-datastream,google-cloud-deploy,google-cloud-developerconnect,google-cloud-devicestreaming,google-cloud-dialogflow,google-cloud-dialogflow-cx,google-cloud-dlp,google-cloud-dms,google-cloud-documentai,google-cloud-domains,google-cloud-edgecontainer,google-cloud-edgenetwork,google-cloud-enterpriseknowledgegraph,google-cloud-error-reporting,google-cloud-essential-contacts,google-cloud-eventarc,google-cloud-eventarc-publishing,google-cloud-filestore,google-cloud-financialservices,google-cloud-firestore,google-cloud-functions,google-cloud-gdchardwaremanagement,google-cloud-geminidataanalytics,google-cloud-gke-backup,google-cloud-gke-connect-gateway,google-cloud-gke-hub,google-cloud-gke-multicloud,google-cloud-gkerecommender,google-cloud-gsuiteaddons,google-cloud-hypercomputecluster,google-cloud-iam,google-cloud-iam-logging,google-cloud-iap,google-cloud-ids,google-cloud-kms,google-cloud-kms-inventory,google-cloud-language,google-cloud-licensemanager,google-cloud-life-sciences,google-cloud-locationfinder,google-cloud-logging,google-cloud-lustre,google-cloud-maintenance-api,google-cloud-managed-identities,google-cloud-managedkafka,google-cloud-managedkafka-schemaregistry,google-cloud-media-translation,google-cloud-memcache,google-cloud-memorystore,google-cloud-migrationcenter,google-cloud-modelarmor,google-cloud-monitoring,google-cloud-monitoring-dashboards,google-cloud-monitoring-metrics-scopes,google-cloud-netapp,google-cloud-network-connectivity,google-cloud-network-management,google-cloud-network-security,google-cloud-network-services,google-cloud-notebooks,google-cloud-optimization,google-cloud-oracledatabase,google-cloud-orchestration-airflow,google-cloud-org-policy,google-cloud-os-config,google-cloud-os-login,google-cloud-parallelstore,google-cloud-parametermanager,google-cloud-phishing-protection,google-cloud-policysimulator,google-cloud-policy-troubleshooter,google-cloud-policytroubleshooter-iam,google-cloud-private-ca,google-cloud-private-catalog,google-cloud-privilegedaccessmanager,google-cloud-quotas,google-cloud-rapidmigrationassessment,google-cloud-recaptcha-enterprise,google-cloud-recommendations-ai,google-cloud-recommender,google-cloud-redis,google-cloud-redis-cluster,google-cloud-resource-manager,google-cloud-retail,google-cloud-run,google-cloud-saasplatform-saasservicemgmt,google-cloud-scheduler,google-cloud-secret-manager,google-cloud-securesourcemanager,google-cloud-securitycenter,google-cloud-securitycentermanagement,google-cloud-security-publicca,google-cloud-service-control,google-cloud-service-directory,google-cloud-servicehealth,google-cloud-service-management,google-cloud-service-usage,google-cloud-shell,google-cloud-source-context,google-cloud-speech,google-cloud-storagebatchoperations,google-cloud-storage-control,google-cloud-storageinsights,google-cloud-storage-transfer,google-cloud-support,google-cloud-talent,google-cloud-tasks,google-cloud-telcoautomation,google-cloud-texttospeech,google-cloud-tpu,google-cloud-trace,google-cloud-translate,google-cloud-vectorsearch,google-cloud-videointelligence,google-cloud-video-live-stream,google-cloud-video-stitcher,google-cloud-video-transcoder,google-cloud-vision,google-cloud-visionai,google-cloud-vm-migration,google-cloud-vmwareengine,google-cloud-vpc-access,google-cloud-webrisk,google-cloud-websecurityscanner,google-cloud-workflows,google-cloud-workloadmanager,google-cloud-workstations,google-geo-type,google-maps-addressvalidation,google-maps-areainsights,google-maps-fleetengine,google-maps-fleetengine-delivery,google-maps-mapsplatformdatasets,google-maps-places,google-maps-routeoptimization,google-maps-routing,google-maps-solar,google-shopping-css,google-shopping-merchant-accounts,google-shopping-merchant-conversions,google-shopping-merchant-datasources,google-shopping-merchant-inventories,google-shopping-merchant-issueresolution,google-shopping-merchant-lfp,google-shopping-merchant-notifications,google-shopping-merchant-ordertracking,google-shopping-merchant-products,google-shopping-merchant-productstudio,google-shopping-merchant-promotions,google-shopping-merchant-quota,google-shopping-merchant-reports,google-shopping-merchant-reviews,google-shopping-type,grafeas
Source-link: googleapis/googleapis@0
END_NESTED_COMMIT
END_COMMIT