Skip to content

feat(bigquery): add bigquery_federated_view_schema_alloydb sample to … - #14742

Open
iennae wants to merge 1 commit into
mainfrom
feat/bq-federated-view-schema-alloydb
Open

iennae wants to merge 1 commit into
mainfrom
feat/bq-federated-view-schema-alloydb

Conversation

@iennae

@iennae iennae commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

…inspect AlloyDB table schema via federated query

Problem:
The BigQuery documentation (https://cloud.google.com/bigquery/docs/alloydb-federated-queries) needs a standalone, tested Python code sample demonstrating how to inspect AlloyDB table schema via federated query (region tag bigquery_federated_view_schema_alloydb).

Solution:

  • Add federated_view_schema_alloydb(project_id: str, connection_id: str) -> None in bigquery/federated_queries/bigquery_federated_view_schema_alloydb.py (Query information_schema.columns in an AlloyDB database from BigQuery using EXTERNAL_QUERY.)
  • Add unit tests (bigquery/federated_queries/bigquery_federated_view_schema_alloydb_test.py) covering both the success path and API error handling (GoogleAPICallError)

Description

Fixes #

Checklist

Testing

  • I have tested this change on a live environment and verified it works as intended.

Compliance & Style


Post-Approval Actions

  • Please merge this PR for me once it is approved

@iennae
iennae requested review from a team and chalmerlowe as code owners November 2, 2026 23:24
@snippet-bot

snippet-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label Bot added api: bigquery Issues related to the BigQuery API. samples Issues that are directly related to samples. labels Nov 2, 2026

@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 a new Python sample script, bigquery_federated_view_schema_alloydb.py, and its corresponding unit tests, which demonstrate how to inspect an AlloyDB table schema from BigQuery using federated queries. It also adds the required configuration and dependency files. The feedback points out that noxfile_config.py should be updated to test the oldest supported Python version (3.10) and the newest, while ignoring intermediate versions (3.11 and 3.12) in accordance with testing guidelines.


TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11"],

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

According to the repository's testing guidelines, only the oldest and newest supported Python releases should be tested in the test configurations, while intermediate versions should be ignored. Since Python 3.10 is the oldest supported version (as specified in requirements-test.txt), it should not be ignored. Instead, intermediate versions like 3.11 and 3.12 should be ignored.

Suggested change
"ignored_versions": ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11"],
"ignored_versions": ["2.7", "3.7", "3.8", "3.9", "3.11", "3.12"],
References
  1. Only test the oldest and newest supported Python releases in test configurations (such as noxfile_config.py), ignoring intermediate versions.

@iennae
iennae force-pushed the feat/bq-federated-view-schema-alloydb branch 2 times, most recently from 06dfbe7 to 7c2ba89 Compare November 3, 2026 02:44
…inspect AlloyDB table schema via federated query

Problem:
The BigQuery documentation (https://cloud.google.com/bigquery/docs/alloydb-federated-queries)
needs a standalone, tested Python code sample demonstrating how to
inspect AlloyDB table schema via federated query (region tag `bigquery_federated_view_schema_alloydb`).

Solution:
- Add `federated_view_schema_alloydb(project_id: str, connection_id: str) -> None` in `bigquery/federated_queries/bigquery_federated_view_schema_alloydb.py`
  (Query information_schema.columns in an AlloyDB database from BigQuery using EXTERNAL_QUERY.)
- Add unit tests (`bigquery/federated_queries/bigquery_federated_view_schema_alloydb_test.py`) covering both the success
  path and API error handling (`GoogleAPICallError`)
@iennae
iennae force-pushed the feat/bq-federated-view-schema-alloydb branch from 7c2ba89 to cba65bc Compare November 3, 2026 23:32

@XrossFox XrossFox 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.

LGTM

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

Labels

api: bigquery Issues related to the BigQuery API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants