jrmccluskey commented on code in PR #24986:
URL: https://github.com/apache/beam/pull/24986#discussion_r1072797044
##########
sdks/python/apache_beam/typehints/typehints.py:
##########
@@ -1190,6 +1190,12 @@ def normalize(x, none_as_type=False):
return type(None)
elif x in _KNOWN_PRIMITIVE_TYPES:
return _KNOWN_PRIMITIVE_TYPES[x]
+ elif sys.version_info >= (3, 9) and isinstance(x, types.GenericAlias):
+ # TODO(https://github.com/apache/beam/issues/23366): handle PEP 585
+ # generic type hints properly
+ raise TypeError(
+ 'PEP 585 generic type hints like %s are not yet supported, '
+ 'use typing module containers instead.' % x)
Review Comment:
Done
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]