Skip to content

Commit 133b1f3

Browse files
committed
remove newtypes getting cast to any in native_type_compatibility.py
1 parent 1939e8e commit 133b1f3

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

sdks/python/apache_beam/typehints/native_type_compatibility.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -319,12 +319,6 @@ def convert_to_beam_type(typ):
319319
# TODO(https://github.com/apache/beam/issues/19954): Currently unhandled.
320320
_LOGGER.info('Converting string literal type hint to Any: "%s"', typ)
321321
return typehints.Any
322-
elif sys.version_info >= (3, 10) and isinstance(typ, typing.NewType): # pylint: disable=isinstance-second-argument-not-valid-type
323-
# Special case for NewType, where, since Python 3.10, NewType is now a class
324-
# rather than a function.
325-
# TODO(https://github.com/apache/beam/issues/20076): Currently unhandled.
326-
_LOGGER.info('Converting NewType type hint to Any: "%s"', typ)
327-
return typehints.Any
328322
elif typ_module == 'apache_beam.typehints.native_type_compatibility' and \
329323
getattr(typ, "__name__", typ.__origin__.__name__) == 'TypedWindowedValue':
330324
# Need to pass through WindowedValue class so that it can be converted

0 commit comments

Comments
 (0)