Skip to content

Ready patch: accept both snippet status key styles in Vertex AI Search client #2749

@Gujiassh

Description

@Gujiassh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions