Repository navigation
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 for running an exact brute-force vector similarity search in BigQuery using the VECTOR_SEARCH function, along with its corresponding unit tests and configuration files. Feedback on the changes suggests updating noxfile_config.py to ensure Python 3.10 is not ignored, as it is the oldest supported Python version and should be tested according to repository guidelines.
|
|
||
| TEST_CONFIG_OVERRIDE = { | ||
| # You can opt out from the test for specific Python versions. | ||
| "ignored_versions": ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11"], |
There was a problem hiding this comment.
According to the repository guidelines, we should only test the oldest and newest supported Python releases in test configurations (such as noxfile_config.py), ignoring intermediate versions. Since Python 3.10 is the oldest supported version, it should not be ignored. Please remove '3.10' from the ignored_versions list so that both the oldest (3.10) and newest supported Python versions are tested, while intermediate versions (like 3.11) remain ignored.
| "ignored_versions": ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11"], | |
| "ignored_versions": ["2.7", "3.7", "3.8", "3.9", "3.11"], |
References
- Only test the oldest and newest supported Python releases in test configurations (such as noxfile_config.py), ignoring intermediate versions.
ededfa9 to
ba85b15
Compare
…exact brute-force vector search Problem: The BigQuery documentation (https://cloud.google.com/bigquery/docs/vector-search) needs a standalone, tested Python code sample demonstrating how to run exact brute-force vector search (region tag `bigquery_vector_search_brute_force`). Solution: - Add `vector_search_brute_force(project_id: str) -> None` in `bigquery/vector_search/bigquery_vector_search_brute_force.py` (Compute exact nearest-neighbor distances over embeddings using VECTOR_SEARCH with use_brute_force => TRUE.) - Add unit tests (`bigquery/vector_search/bigquery_vector_search_brute_force_test.py`) covering both the success path and API error handling (`GoogleAPICallError`)
ba85b15 to
18cca94
Compare
XrossFox
left a comment
There was a problem hiding this comment.
Code does LGTM, but i have a bit of a nit regarding monkeypatching the base dependency rather that the module instance.
| def test_vector_search_brute_force_success( | ||
| capsys: pytest.CaptureFixture[str], | ||
| ) -> None: | ||
| with mock.patch("google.cloud.bigquery.Client") as mock_client_cls: |
There was a problem hiding this comment.
Patch should target the module instance under test rather than the dependency global instance
| def test_vector_search_brute_force_error( | ||
| capsys: pytest.CaptureFixture[str], | ||
| ) -> None: | ||
| with mock.patch("google.cloud.bigquery.Client") as mock_client_cls: |
…exact brute-force vector search
Problem:
The BigQuery documentation (https://cloud.google.com/bigquery/docs/vector-search) needs a standalone, tested Python code sample demonstrating how to run exact brute-force vector search (region tag
bigquery_vector_search_brute_force).Solution:
vector_search_brute_force(project_id: str) -> Noneinbigquery/vector_search/bigquery_vector_search_brute_force.py(Compute exact nearest-neighbor distances over embeddings using VECTOR_SEARCH with use_brute_force => TRUE.)bigquery/vector_search/bigquery_vector_search_brute_force_test.py) covering both the success path and API error handling (GoogleAPICallError)Description
Fixes #
Checklist
Testing
Compliance & Style
Post-Approval Actions