claudevdm commented on code in PR #37434:
URL: https://github.com/apache/beam/pull/37434#discussion_r2738347077


##########
sdks/python/apache_beam/typehints/decorators.py:
##########
@@ -182,6 +187,140 @@ def disable_type_annotations():
 TRACEBACK_LIMIT = 5
 
 
+def _tag_and_type(t):
+  """Extract tag name and value type from TaggedOutput[Literal['tag'], Type].
+
+  Returns raw Python types - conversion to beam types happens in
+  _extract_output_types.
+  """
+  args = get_args(t)
+  if len(args) != 2:

Review Comment:
   Actually, should this fail or just warn? I saw an issue 
https://github.com/apache/beam/issues/26493 where someone is using typehint `-> 
Iterable[Union[Dict[str, Any], pvalue.TaggedOutput]]:`
   
   Their pipeline will break until they fix the typehint. Maybe we should 
rather warn that the tagged typehints cannot be parsed instead of throwing



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