Repository navigation
feat(bigquery): add bigquery_query_manifest_external_table sample to … - #14715
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, query_manifest_external_table, along with its corresponding unit tests and configuration files. The sample demonstrates how to configure a newline-delimited manifest on a BigQuery external table and query it. The review feedback points out that the test configuration in noxfile_config.py should be updated to test only the oldest (3.10) and newest (3.13) supported Python versions, meaning intermediate versions (3.11 and 3.12) should be ignored instead of 3.10.
XrossFox
left a comment
There was a problem hiding this comment.
LGTM, some dependencies are outdated.
| google-cloud-bigquery==3.35.1 | ||
| google-cloud-bigquery-storage==2.32.0 |
There was a problem hiding this comment.
bigquery and bigquery storage should be upgraded, to 3.47.0 and 3.17.1 versions respectively.
79568e2 to
b585eba
Compare
…query an external table defined by a manifest file Problem: The BigQuery documentation (https://cloud.google.com/bigquery/docs/query-open-table-format-using-manifest-files) needs a standalone, tested Python code sample demonstrating how to query an external table defined by a manifest file (region tag `bigquery_query_manifest_external_table`). Solution: - Add `query_manifest_external_table(project_id: str, dataset_id: str, table_id: str, manifest_uri: str) -> None` in `bigquery/biglake/bigquery_query_manifest_external_table.py` (Run a GoogleSQL query against an open-table-format external table backed by a manifest file on Cloud Storage.) - Add unit tests (`bigquery/biglake/bigquery_query_manifest_external_table_test.py`) covering both the success path and API error handling (`GoogleAPICallError`)
b585eba to
4031908
Compare
… up test mocks Problem: Following review feedback across the BigQuery sample PRs (#14714, #14715, #14717): - `bigquery_create_search_index.py` should use `CREATE SEARCH INDEX IF NOT EXISTS` and handle `exceptions.NotFound` when the parent table or dataset is missing. - `bigquery_drop_vector_index.py` `NotFound` error message should reflect that `DROP VECTOR INDEX IF EXISTS` raises `NotFound` when the parent table or dataset is missing. - Unit tests in `bigquery_create_search_index_test.py`, `bigquery_drop_vector_index_test.py`, and `bigquery_query_manifest_external_table_test.py` defined unused mock attributes (`mock_row` on DDL statements and `mock_job.statement_type` on SELECT queries). Solution: - Restore `CREATE SEARCH INDEX IF NOT EXISTS` and catch `exceptions.NotFound` in `bigquery/search/bigquery_create_search_index.py` and its unit test. - Update the `NotFound` error message in `bigquery/vector_search/bigquery_drop_vector_index.py`. - Remove unused `mock_row` and `mock_job.statement_type` setup in the three corresponding unit test files.
…query an external table defined by a manifest file
Problem:
The BigQuery documentation (https://cloud.google.com/bigquery/docs/query-open-table-format-using-manifest-files) needs a standalone, tested Python code sample demonstrating how to query an external table defined by a manifest file (region tag
bigquery_query_manifest_external_table).Solution:
query_manifest_external_table(project_id: str, dataset_id: str, table_id: str, manifest_uri: str) -> Noneinbigquery/biglake/bigquery_query_manifest_external_table.py(Run a GoogleSQL query against an open-table-format external table backed by a manifest file on Cloud Storage.)bigquery/biglake/bigquery_query_manifest_external_table_test.py) covering both the success path and API error handling (GoogleAPICallError)Checklist
Testing
Compliance & Style
Post-Approval Actions