Skip to content

[DRAFT] feat(translate): support custom universe domains in translate_v2 - #19235

Draft
daniel-sanche wants to merge 2 commits into
python_bug_burndown_track_five_google-cloud-runtimeconfig_03_universe-domainfrom
python_bug_burndown_track_five_google-cloud-translate_04_universe-domain
Draft

daniel-sanche wants to merge 2 commits into
python_bug_burndown_track_five_google-cloud-runtimeconfig_03_universe-domainfrom
python_bug_burndown_track_five_google-cloud-translate_04_universe-domain

Conversation

@daniel-sanche

@daniel-sanche daniel-sanche commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Adds custom universe domain support to google.cloud.translate_v2 using the shared Client and JSONConnection helpers in google-cloud-core:

  • Resolves universe_domain from client_options or GOOGLE_CLOUD_UNIVERSE_DOMAIN and validates credential universe compatibility on translate_v2.Client initialization.
  • Templates default Cloud Translation v2 endpoints as https://translation.{universe_domain} while preserving explicit api_endpoint overrides.
  • Bumps the google-cloud-core dependency floor to >= 2.9.0, < 3.0.0 (including Librarian post-processing rules for setup.py and constraints-3.10.txt).
    • Allows us to use the new universe domain resolution and credential protections in google-cloud-core.
    • Diamond dependencies are less of a concern for google-cloud-core since it is pure Python, doesn't raise transitive floors, and has a much smaller footprint than google-api-core, google-auth, or grpcio.

Blocked on release of google-cloud-core v2.9.0

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for custom universe domains in the Google Cloud Translation v2 client. Key changes include updating the google-cloud-core dependency to >= 2.9.0, delegating client options and endpoint configuration to the base client, validating the credentials universe, and adding comprehensive unit tests. Feedback suggests combining the separate imports from google.cloud.client into a single statement to improve code readability.

Comment on lines +17 to +22
from google.cloud.client import (
Client as BaseClient,
)
from google.cloud.client import (
_validate_credentials_universe,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These two import statements from the same module google.cloud.client can be combined into a single import statement to improve readability and maintainability.

from google.cloud.client import (
    Client as BaseClient,
    _validate_credentials_universe,
)

@chalmerlowe

Copy link
Copy Markdown
Contributor

@daniel-sanche

SYNC WARNING:

See this comment in #19231 regarding some possible areas to sync up.

@daniel-sanche
daniel-sanche force-pushed the python_bug_burndown_track_five_google-cloud-translate_04_universe-domain branch from 641310b to 21ac1b8 Compare November 30, 2026 19:15
@daniel-sanche
daniel-sanche force-pushed the python_bug_burndown_track_five_google-cloud-translate_04_universe-domain branch from 21ac1b8 to 29d1f8f Compare November 30, 2026 20:42

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants