Skip to content

Commit 9fcabc6

Browse files
committed
Check the existence of _fields instead of __annotations__ for NamedTuple.
1 parent 449ab57 commit 9fcabc6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sdks/python/apache_beam/typehints/native_type_compatibility.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def _match_is_exactly_sequence(user_type):
164164
def match_is_named_tuple(user_type):
165165
return (
166166
_safe_issubclass(user_type, typing.Tuple) and
167-
hasattr(user_type, '__annotations__'))
167+
hasattr(user_type, '_fields'))
168168

169169

170170
def _match_is_optional(user_type):

0 commit comments

Comments
 (0)