liferoad commented on code in PR #25743:
URL: https://github.com/apache/beam/pull/25743#discussion_r1127300944
##########
sdks/python/apache_beam/transforms/core.py:
##########
@@ -1387,6 +1387,11 @@ def partition_for(self, element, num_partitions, *args,
**kwargs):
return self._fn(element, num_partitions, *args, **kwargs)
+def _check_fn_use_yield_and_return(fn):
+ source_code = inspect.getsource(fn)
+ return " yield " in source_code and " return " in source_code
Review Comment:
only check the function source code to check yield and return, which should
cover most of cases.
--
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]