Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates BigQuery search and vector index scripts and their corresponding tests. Specifically, it modifies the search index creation to use 'CREATE SEARCH INDEX IF NOT EXISTS' and updates the exception handling to catch 'exceptions.NotFound' instead of 'exceptions.AlreadyExists'. Additionally, it refactors error messages for missing tables or datasets in the vector index drop script and updates unit tests to use empty list results for mock query jobs. There are no review comments, so I have no feedback to provide.
… 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.
iennae
force-pushed
the
fix/bq-merged-samples-cleanup
branch
from
November 3, 2026 23:32
2ac3d30 to
260d2cb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up cleanup for recently merged BigQuery sample PRs (#14714, #14715, #14717):
bigquery/search/bigquery_create_search_index.py&bigquery_create_search_index_test.py(feat(bigquery): add bigquery_create_search_index sample to create a s… #14714): RestoreCREATE SEARCH INDEX IF NOT EXISTSand catch/testexceptions.NotFoundfor missing parent table or dataset, and remove unusedmock_rowfrom the DDL test.bigquery/vector_search/bigquery_drop_vector_index.py&bigquery_drop_vector_index_test.py(feat(bigquery): add bigquery_drop_vector_index sample to drop a vecto… #14717): Clarifyexcept exceptions.NotFoundmessage (raised when parent table or dataset is not found sinceDROP VECTOR INDEX IF EXISTSis idempotent) and remove unusedmock_rowfrom the DDL test.bigquery/biglake/bigquery_query_manifest_external_table_test.py(feat(bigquery): add bigquery_query_manifest_external_table sample to … #14715): Remove unusedmock_job.statement_typemock attribute.