damccorm commented on code in PR #36703:
URL: https://github.com/apache/beam/pull/36703#discussion_r2482513964


##########
sdks/python/apache_beam/transforms/core.py:
##########
@@ -1507,25 +1507,28 @@ def _check_fn_use_yield_and_return(fn):
     source_code = _get_function_body_without_inners(fn)
     has_yield = False
     has_return = False
-    return_none_warning = (
-        "No iterator is returned by the process method in %s.",
-        fn.__self__.__class__)
+    has_return_none = False
     for line in source_code.split("\n"):
       lstripped_line = line.lstrip()
       if lstripped_line.startswith("yield ") or lstripped_line.startswith(
           "yield("):
         has_yield = True
-      if lstripped_line.startswith("return ") or lstripped_line.startswith(
+      elif lstripped_line.rstrip() == "return":
+        has_return_none = True

Review Comment:
   Maybe we can even skip this case? It seems like the only potentially 
problematic case is when they're expecting `None` to be processed downstream, 
in this case I think they probably have correct expectations



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