Skip to content

feat(sqlalchemy-bigquery): support client_options in BigQueryDialect and create_bigquery_client - #19294

Draft
chalmerlowe wants to merge 1 commit into
mainfrom
fix/sqlalchemy-bigquery-universe
Draft

chalmerlowe wants to merge 1 commit into
mainfrom
fix/sqlalchemy-bigquery-universe

Conversation

@chalmerlowe

Copy link
Copy Markdown
Contributor

Summary

Adds optional client_options support to sqlalchemy_bigquery._helpers.create_bigquery_client() and BigQueryDialect.__init__() / create_connect_args(), forwarding client_options (including universe_domain and api_endpoint) directly to google.cloud.bigquery.Client(...).

  • sqlalchemy_bigquery/_helpers.py: Accepts client_options (ClientOptions, Mapping, or None) in create_bigquery_client() and forwards it to bigquery.Client(...).
  • sqlalchemy_bigquery/base.py: Accepts client_options in BigQueryDialect.__init__() (so callers can pass create_engine("bigquery://...", client_options=...)) and forwards self.client_options in create_connect_args().
  • tests/unit/test_universe_domain.py: Adds unit tests verifying ClientOptions, dict, MappingProxyType, and None forwarding across create_bigquery_client, BigQueryDialect, and sqlalchemy.create_engine.

Internal tracking: b/589769802

@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 adds support for passing client_options (such as universe_domain or api_endpoint) to the BigQuery client via the SQLAlchemy dialect. It updates create_bigquery_client and BigQueryDialect to accept and forward these options, and adds comprehensive unit tests to verify this behavior. No review comments were provided, so there is no additional feedback.

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.

1 participant