Skip to content

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

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

adri22235 wants to merge 15 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.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants