chadrik commented on a change in pull request #13004:
URL: https://github.com/apache/beam/pull/13004#discussion_r499832592



##########
File path: sdks/python/apache_beam/transforms/core.py
##########
@@ -2465,22 +2470,28 @@ def expand(self, pcoll):
     return pcoll | Map(lambda x: (self._key_func()(x), x)) | GroupByKey()
 
 
-_dynamic_named_tuple_cache = {}
+_dynamic_named_tuple_cache = {
+}  # type: typing.Dict[typing.Tuple[str, typing.Tuple[str, ...]], 
typing.Type[tuple]]
 
 
 def _dynamic_named_tuple(type_name, field_names):
+  # type: (str, typing.Tuple[str, ...]) -> typing.Type[tuple]
   cache_key = (type_name, field_names)
   result = _dynamic_named_tuple_cache.get(cache_key)
   if result is None:
     import collections
     result = _dynamic_named_tuple_cache[cache_key] = collections.namedtuple(
         type_name, field_names)
-    result.__reduce__ = lambda self: (
-        _unpickle_dynamic_named_tuple, (type_name, field_names, tuple(self)))
+    if not typing.TYPE_CHECKING:

Review comment:
       Sure, I'll make that change.  




----------------------------------------------------------------
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]


Reply via email to