Skip to content

fix(transformers): correctly handle non-iterable and None content types - #3217

Open
adri22235 wants to merge 16 commits into
googleapis:mainfrom
adri22235:fix/transformers-contents-iterable-type
Open

adri22235 wants to merge 16 commits into
googleapis:mainfrom
adri22235:fix/transformers-contents-iterable-type

Conversation

@adri22235

Copy link
Copy Markdown

Summary

Fixes Mypy [arg-type] failure in _transformers.py:477 where contents was converted via list(contents) without handling single content objects (File, Part, Image) or None.

Changes Included

  • Checks for None before conversion.
  • Safely wraps non-iterable single items into a list.
  • Passes all Mypy 3.11 type checks without error.

Verified with Google CLA signed by @adri22235.

@Venkaiahbabuneelam Venkaiahbabuneelam self-assigned this Oct 27, 2026
@Venkaiahbabuneelam Venkaiahbabuneelam added the size:XL Code changes > 100 lines label Oct 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL Code changes > 100 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants