You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 260d2cb
Browse filesBrowse the repository at this point in the historyBrowse files
fix(bigquery): restore IF NOT EXISTS in create_search_index and clean 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.
0 commit comments