Skip to content

fix(google-genai): Guard response extraction - #5869

Merged
alexander-alderman-webb merged 1 commit into
masterfrom
webb/google-genai/candidate-none-checks
Mar 26, 2026
Merged

alexander-alderman-webb merged 1 commit into
masterfrom
webb/google-genai/candidate-none-checks

Conversation

@alexander-alderman-webb

Copy link
Copy Markdown
Collaborator

Description

Both fields are declared to be optional:

https://github.com/googleapis/python-genai/blob/f4bcca45e0805c798ee86530e013a0c325d0af85/google/genai/types.py#L7485

https://github.com/googleapis/python-genai/blob/f4bcca45e0805c798ee86530e013a0c325d0af85/google/genai/types.py#L2145

Issues

Closes #5854

Reminders

@alexander-alderman-webb
alexander-alderman-webb requested a review from a team as a code owner March 25, 2026 15:48
@github-actions

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Langchain

  • Set gen_ai.operation.name and gen_ai.pipeline.name on LLM spans by ericapisani in #5849
  • Broaden AI provider detection beyond OpenAI and Anthropic by ericapisani in #5707
  • Update LLM span operation to gen_ai.generate_text by ericapisani in #5796

Bug Fixes 🐛

  • (google-genai) Guard response extraction by alexander-alderman-webb in #5869

Internal Changes 🔧

Langchain

  • Add text completion test by alexander-alderman-webb in #5740
  • Add tool execution test by alexander-alderman-webb in #5739
  • Add basic agent test with Responses call by alexander-alderman-webb in #5726
  • Replace mocks with httpx types by alexander-alderman-webb in #5724
  • Consolidate span origin assertion by alexander-alderman-webb in #5723
  • Consolidate available tools assertion by alexander-alderman-webb in #5721

Other

  • (asyncpg) Normalize query whitespace in integration by ericapisani in #5855
  • Add note to coordinate with assignee before PR submission by sentrivana in #5868
  • Temporarily stop running litellm tests by alexander-alderman-webb in #5851

Other

  • ci+docs: Add draft PR enforcement by stephanie-anderson in #5867

🤖 This preview updates automatically when you update the PR.

@github-actions

github-actions Bot commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ 13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 9.08s

📊 Comparison with Base Branch

Metric Change
Total Tests —
Passed Tests —
Failed Tests —
Skipped Tests —

✨ No test changes detected

All tests are passing successfully.

❌ Patch coverage is 0.00%. Project has 14391 uncovered lines.
✅ Project coverage is 30.23%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
utils.py 0.00% ⚠️ 481 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    25.32%    30.23%    +4.91%
==========================================
  Files          189       189         —
  Lines        20625     20627        +2
  Branches      6738      6740        +2
==========================================
+ Hits          5223      6236     +1013
- Misses       15402     14391     -1011
- Partials       429       474       +45

Generated by Codecov Action

@alexander-alderman-webb
alexander-alderman-webb merged commit bcfb788 into master Mar 26, 2026
159 checks passed
@alexander-alderman-webb
alexander-alderman-webb deleted the webb/google-genai/candidate-none-checks branch March 26, 2026 09:16
mgaligniana pushed a commit to mgaligniana/sentry-python that referenced this pull request Aug 9, 2026
ianmatson added a commit to cosmonaut-ai/cosmonaut-api that referenced this pull request Nov 1, 2026
Validate the <world_info> block in a pydantic-ai output validator with
two bounded output retries instead of parsing after the run, so missing
wrappers or schema-invalid JSON are re-prompted rather than failing the
queue job. Retry feedback excludes raw model output and the original
validation exception is detached from the retry exception chain.

Raise the sentry-sdk floor to 2.57.0 and narrowly lock that version,
which guards Google GenAI response extraction against content.parts
being None (getsentry/sentry-python#5869).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: 'NoneType' object is not iterable in google_genai integration

2 participants