I prepared a small fix for search/cloud-function/python/vertex_ai_search_client.py that accepts both snippetStatus and snippet_status when parsing snippet-only document results.
The branch is already pushed here:
Why this matters:
- some payloads use snake_case
snippet_status
- the current parser only accepts camelCase
snippetStatus
- when that happens, snippet-only results get silently dropped even though the snippet succeeded
Patch contents:
- accept both key styles in
_parse_snippets
- add a regression test covering both variants in
test_vertex_ai_search_client.py
Local verification on the branch:
search/cloud-function/python/.venv/bin/python -m pytest test_vertex_ai_search_client.py -k snippet_only_accepts_snippet_status_variants -q
search/cloud-function/python/.venv/bin/python -m pytest test_vertex_ai_search_client.py -q
I wasn't able to open a PR directly because GitHub rejected CreatePullRequest for this repository from my account, but the branch and compare URL are ready if a maintainer wants to cherry-pick or reopen it as a PR.
I prepared a small fix for
search/cloud-function/python/vertex_ai_search_client.pythat accepts bothsnippetStatusandsnippet_statuswhen parsing snippet-only document results.The branch is already pushed here:
Gujiassh:fix/snippet-status-key-compatWhy this matters:
snippet_statussnippetStatusPatch contents:
_parse_snippetstest_vertex_ai_search_client.pyLocal verification on the branch:
search/cloud-function/python/.venv/bin/python -m pytest test_vertex_ai_search_client.py -k snippet_only_accepts_snippet_status_variants -qsearch/cloud-function/python/.venv/bin/python -m pytest test_vertex_ai_search_client.py -qI wasn't able to open a PR directly because GitHub rejected
CreatePullRequestfor this repository from my account, but the branch and compare URL are ready if a maintainer wants to cherry-pick or reopen it as a PR.