nehsyc commented on a change in pull request #13493:
URL: https://github.com/apache/beam/pull/13493#discussion_r538914797
##########
File path: sdks/python/apache_beam/transforms/util.py
##########
@@ -72,6 +72,9 @@
from apache_beam.transforms.window import NonMergingWindowFn
from apache_beam.transforms.window import TimestampCombiner
from apache_beam.transforms.window import TimestampedValue
+from apache_beam.typehints.sharded_key_type import ShardedKeyType
+from apache_beam.typehints.typehints import IterableTypeConstraint
+from apache_beam.typehints.typehints import TupleConstraint
Review comment:
Updated the code to use `Tuple` and `Iterable` directly. Couldn't add
`ShardedKeyType` to `apache_beam/typehints/__init__.py` due to circular imports
in coders
```
ImportError while loading conftest
'/usr/local/google/home/sychen/Documents/GitHub/working_dir/beam/sdks/python/conftest.py'.
conftest.py:23: in <module>
from apache_beam.options import pipeline_options
apache_beam/__init__.py:95: in <module>
from apache_beam import coders
apache_beam/coders/__init__.py:19: in <module>
from apache_beam.coders.coders import *
apache_beam/coders/coders.py:52: in <module>
from apache_beam.typehints import typehints
apache_beam/typehints/__init__.py:25: in <module>
from apache_beam.typehints.sharded_key_type import ShardedKeyType
apache_beam/typehints/sharded_key_type.py:22: in <module>
from apache_beam.coders import typecoders
apache_beam/coders/typecoders.py:81: in <module>
from apache_beam.coders.coders import CoderElementType
E ImportError: cannot import name 'CoderElementType' from partially
initialized module 'apache_beam.coders.coders' (most likely due to a circular
import)
(/usr/local/google/home/sychen/Documents/GitHub/working_dir/beam/sdks/python/apache_beam/coders/coders.py)
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]