jrmccluskey commented on code in PR #41334:
URL: https://github.com/apache/beam/pull/41334#discussion_r4744679141


##########
sdks/python/apache_beam/typehints/opcodes.py:
##########
@@ -484,15 +505,41 @@ def _getattr(o, name):
     func = getattr(o, name)  # Python 3 has no unbound methods
     return Const(BoundMethod(func, o))
   elif isinstance(o, row_type.RowTypeConstraint):
-    return o.get_type_for(name)
-  elif inspect.isclass(o) and dataclasses.is_dataclass(o):
-    field = o.__dataclass_fields__.get(name)
+    return typehints.normalize(o.get_type_for(name))
+  elif inspect.isclass(o):
+    if match_is_named_tuple(o):

Review Comment:
   I'm not entirely certain I like doing all of the processing and 
normalization here in opcodes.py. Have you looked at potential changes to 
[convert_to_beam_type()](https://github.com/apache/beam/blob/master/sdks/python/apache_beam/typehints/native_type_compatibility.py#L380)
 that might help here? 



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

Reply via email to