You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/09/20 20:30:36 UTC

[GitHub] [beam] TheNeuralBit commented on a change in pull request #15539: [BEAM-12803] Update deprecated use of _field_types

TheNeuralBit commented on a change in pull request #15539:
URL: https://github.com/apache/beam/pull/15539#discussion_r712491402



##########
File path: sdks/python/apache_beam/typehints/native_type_compatibility.py
##########
@@ -107,7 +107,7 @@ def _match_is_exactly_iterable(user_type):
 def match_is_named_tuple(user_type):
   return (
       _safe_issubclass(user_type, typing.Tuple) and
-      hasattr(user_type, '_field_types'))
+      hasattr(user_type, '__annotations__'))

Review comment:
       Are we sure this won't lead to false positives? That is, are we sure the only way a tuple subclass will have an `__annotations__` attribute is when it's a `NamedTuple`?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org