Repository navigation
feat(bigquery): add bigquery_drop_vector_index sample to drop a vecto… - #14717
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 script and unit tests for dropping a BigQuery vector index. The feedback recommends updating the test configuration in noxfile_config.py to ignore intermediate Python versions, ensuring that only the oldest and newest supported releases are tested in compliance with repository guidelines.
XrossFox
left a comment
There was a problem hiding this comment.
LGTM, one depenedency is outdated.
| @@ -0,0 +1 @@ | |||
| google-cloud-bigquery==3.35.1 | |||
There was a problem hiding this comment.
Thise dependency is out of date, newest version of bigquery is 3.47.0
7dc065c to
ff22bd2
Compare
…r index from a table Problem: The BigQuery documentation (https://cloud.google.com/bigquery/docs/vector-index) needs a standalone, tested Python code sample demonstrating how to drop a vector index from a table (region tag `bigquery_drop_vector_index`). Solution: - Add `drop_vector_index(project_id: str, dataset_id: str, table_id: str) -> None` in `bigquery/vector_search/bigquery_drop_vector_index.py` (Remove a vector index from a BigQuery table using DROP VECTOR INDEX IF EXISTS.) - Add unit tests (`bigquery/vector_search/bigquery_drop_vector_index_test.py`) covering both the success path and API error handling (`GoogleAPICallError`)
ff22bd2 to
b736666
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.
…r index from a table
Problem:
The BigQuery documentation (https://cloud.google.com/bigquery/docs/vector-index) needs a standalone, tested Python code sample demonstrating how to drop a vector index from a table (region tag
bigquery_drop_vector_index).Solution:
drop_vector_index(project_id: str, dataset_id: str, table_id: str) -> Noneinbigquery/vector_search/bigquery_drop_vector_index.py(Remove a vector index from a BigQuery table using DROP VECTOR INDEX IF EXISTS.)bigquery/vector_search/bigquery_drop_vector_index_test.py) covering both the success path and API error handling (GoogleAPICallError)Checklist
Testing
Compliance & Style
Post-Approval Actions