Abacn commented on code in PR #37855:
URL: https://github.com/apache/beam/pull/37855#discussion_r2962993552
##########
sdks/python/apache_beam/typehints/native_type_compatibility.py:
##########
@@ -176,8 +176,30 @@ def match_is_named_tuple(user_type):
hasattr(user_type, '__annotations__') and hasattr(user_type, '_fields'))
-def match_is_dataclass(user_type):
- return dataclasses.is_dataclass(user_type) and isinstance(user_type, type)
+def match_dataclass_for_row(user_type):
Review Comment:
> So to be clear, coders are only changed when schema_from_element_type is
called
Yes it affects UnionHint, but even for types incompatible for union schema,
e.g. `(SomeDataclass | None)` or `OptionalHint`, default coder for the former
still gets changed because "named_fields_from_element_type" (calls
schema_from_element_type) get evaluated before checking schema compatibility.
This made blasting radius fairly large.
https://github.com/apache/beam/pull/37855/changes/BASE..ed6e34ba22f5fb69063b687688edd48f14ccdee1#diff-d31b9184f7423473c4e6deda80b237aa474228143a0bab2faedd9afe2e944982L661
--
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]