Repository navigation
feat(bigquery): add bigquery_federated_view_schema_cloud_sql sample t… - #14735
Conversation
|
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new Python sample and associated unit tests for viewing a Cloud SQL table schema from BigQuery using an external query. It also adds the necessary configuration and dependency files for testing. The review feedback recommends updating the noxfile_config.py to align with testing guidelines by only testing the oldest and newest supported Python versions (3.10 and 3.13) and ignoring the intermediate versions (3.11 and 3.12).
6c161ea to
5515f11
Compare
XrossFox
left a comment
There was a problem hiding this comment.
LGTM, mock for failing test could swap where exception is raised to mock_client.result.
…o inspect Cloud SQL table schema via federated query Problem: The BigQuery documentation (https://cloud.google.com/bigquery/docs/cloud-sql-federated-queries) needs a standalone, tested Python code sample demonstrating how to inspect Cloud SQL table schema via federated query (region tag `bigquery_federated_view_schema_cloud_sql`). Solution: - Add `federated_view_schema_cloud_sql(project_id: str, connection_id: str) -> None` in `bigquery/federated_queries/bigquery_federated_view_schema_cloud_sql.py` (Query information_schema.columns in a Cloud SQL database from BigQuery using EXTERNAL_QUERY.) - Add unit tests (`bigquery/federated_queries/bigquery_federated_view_schema_cloud_sql_test.py`) covering both the success path and API error handling (`GoogleAPICallError`)
5515f11 to
2aac8a1
Compare
…o inspect Cloud SQL table schema via federated query
Problem:
The BigQuery documentation (https://cloud.google.com/bigquery/docs/cloud-sql-federated-queries) needs a standalone, tested Python code sample demonstrating how to inspect Cloud SQL table schema via federated query (region tag
bigquery_federated_view_schema_cloud_sql).Solution:
federated_view_schema_cloud_sql(project_id: str, connection_id: str) -> Noneinbigquery/federated_queries/bigquery_federated_view_schema_cloud_sql.py(Query information_schema.columns in a Cloud SQL database from BigQuery using EXTERNAL_QUERY.)bigquery/federated_queries/bigquery_federated_view_schema_cloud_sql_test.py) covering both the success path and API error handling (GoogleAPICallError)Description
Fixes #
Checklist
Testing
Compliance & Style
Post-Approval Actions