Skip to content

feat(bigquery): add bigquery_search_with_text_analyzer sample to sear… - #14738

Merged
iennae merged 1 commit into
mainfrom
feat/bq-search-with-text-analyzer
Nov 5, 2026
Merged

iennae merged 1 commit into
mainfrom
feat/bq-search-with-text-analyzer

Conversation

@iennae

@iennae iennae commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

…ch text using a specified text analyzer

Problem:
The BigQuery documentation (https://cloud.google.com/bigquery/docs/search) needs a standalone, tested Python code sample demonstrating how to search text using a specified text analyzer (region tag bigquery_search_with_text_analyzer).

Solution:

  • Add search_with_text_analyzer(project_id: str) -> None in bigquery/search/bigquery_search_with_text_analyzer.py (Run a BigQuery SEARCH query specifying an explicit text analyzer such as LOG_ANALYZER, NO_OP_ANALYZER, or PATTERN_ANALYZER.)
  • Add unit tests (bigquery/search/bigquery_search_with_text_analyzer_test.py) covering both the success path and API error handling (GoogleAPICallError)

Description

Fixes #

Checklist

Testing

  • I have tested this change on a live environment and verified it works as intended.

Compliance & Style


Post-Approval Actions

  • Please merge this PR for me once it is approved

@iennae
iennae requested review from a team and chalmerlowe as code owners November 2, 2026 23:22
@snippet-bot

snippet-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label Bot added api: bigquery Issues related to the BigQuery API. samples Issues that are directly related to samples. labels Nov 2, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new BigQuery code sample, 'search_with_text_analyzer.py', demonstrating how to perform case-sensitive exact substring matching using the 'NO_OP_ANALYZER' in BigQuery's 'SEARCH' function. It also includes corresponding unit tests, dependency files, and a Nox configuration. The feedback recommends updating 'noxfile_config.py' to remove Python version '3.10' from the 'ignored_versions' list, ensuring that the oldest supported Python version is properly tested.


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"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the repository's general rules, we should only test the oldest and newest supported Python releases in test configurations, ignoring intermediate versions. Since the oldest supported version is 3.10 (as specified in requirements-test.txt), please remove "3.10" from ignored_versions so that it is tested, while keeping "3.11" ignored as an intermediate version.

Suggested change
"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
  1. Only test the oldest and newest supported Python releases in test configurations (such as noxfile_config.py), ignoring intermediate versions.

@iennae
iennae force-pushed the feat/bq-search-with-text-analyzer branch 2 times, most recently from 31b1150 to 73e1ca5 Compare November 3, 2026 02:44
…ch text using a specified text analyzer

Problem:
The BigQuery documentation (https://cloud.google.com/bigquery/docs/search)
needs a standalone, tested Python code sample demonstrating how to
search text using a specified text analyzer (region tag `bigquery_search_with_text_analyzer`).

Solution:
- Add `search_with_text_analyzer(project_id: str) -> None` in `bigquery/search/bigquery_search_with_text_analyzer.py`
  (Run a BigQuery SEARCH query specifying an explicit text analyzer such as LOG_ANALYZER, NO_OP_ANALYZER, or PATTERN_ANALYZER.)
- Add unit tests (`bigquery/search/bigquery_search_with_text_analyzer_test.py`) covering both the success
  path and API error handling (`GoogleAPICallError`)
@iennae
iennae force-pushed the feat/bq-search-with-text-analyzer branch from 73e1ca5 to 9dcdf2e Compare November 3, 2026 23:32

@XrossFox XrossFox left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iennae
iennae merged commit b13006b into main Nov 5, 2026
14 of 22 checks passed
@iennae
iennae deleted the feat/bq-search-with-text-analyzer branch November 5, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the BigQuery API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants