chrisqiqiu commented on code in PR #38429:
URL: https://github.com/apache/beam/pull/38429#discussion_r3215117722


##########
sdks/python/apache_beam/runners/common.py:
##########
@@ -1667,6 +1676,13 @@ def handle_process_outputs(
     if results is None:
       results = []
 
+    if self._check_user_dofn_output and isinstance(results, (str, bytes, 
dict)):
+      object_type = type(results).__name__
+      raise TypeError(
+          'Returning a %s from a ParDo or FlatMap is discouraged. '
+          'Please use list("%s") if you really want this behavior.' %
+          (object_type, results))

Review Comment:
   the existing _check_type in typehints/typecheck.py has the same bug we 
inherited from. Applied in the follow-up commit.



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