Repository navigation
[Cherrypick] Fix forward references that do not resolve to types (#41184) - #41243
Conversation
* Fix forward references that do not resolve to types * yapf * Fix extra broken edge cases * Apply suggestion from @claudevdm Co-authored-by: claudevdm <33973061+claudevdm@users.noreply.github.com> --------- Co-authored-by: claudevdm <33973061+claudevdm@users.noreply.github.com>
There was a problem hiding this comment.
📋 Review Summary
This PR is a clean cherry-pick of #41184 onto the release-2.78 branch to fix a regression where resolved forward references or deferred string annotations that do not convert to valid Beam type hints (such as protobuf EnumTypeWrapper instances or single-argument collections.abc.Generator) raise errors instead of falling back to Any. The implementation in _is_convertible_type_hint and accompanying test suite are thorough and ready to merge.
🔍 General Feedback
_is_convertible_type_hintproperly validates converted Beam types while preserving resolution forTypeVar,NewType,Literal,Annotated, and Python 3.12typealiases.- Unit and pipeline tests in
decorators_test.pyandtyped_pipeline_test.pythoroughly cover string annotations,from __future__ import annotations, and edge cases.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-2.78 #41243 +/- ##
=================================================
+ Coverage 0 79.82% +79.82%
=================================================
Files 0 494 +494
Lines 0 83595 +83595
=================================================
+ Hits 0 66727 +66727
- Misses 0 16868 +16868
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fix forward references that do not resolve to types
yapf
Fix extra broken edge cases
Apply suggestion from @claudevdm