robertwb commented on code in PR #28546:
URL: https://github.com/apache/beam/pull/28546#discussion_r1334848505


##########
sdks/python/apache_beam/yaml/yaml_provider.py:
##########
@@ -508,19 +510,14 @@ def _parse_window_spec(spec):
       # TODO: Triggering, etc.
       return beam.WindowInto(window_fn)
 
+  def log_and_return(x):
+    logging.info(x)
+    return x
+
   return InlineProvider(
       dict({
           'Create': create,
-          'PyMap': lambda fn: beam.Map(
-              python_callable.PythonCallableWithSource(fn)),
-          'PyMapTuple': lambda fn: beam.MapTuple(
-              python_callable.PythonCallableWithSource(fn)),
-          'PyFlatMap': lambda fn: beam.FlatMap(
-              python_callable.PythonCallableWithSource(fn)),
-          'PyFlatMapTuple': lambda fn: beam.FlatMapTuple(
-              python_callable.PythonCallableWithSource(fn)),
-          'PyFilter': lambda keep: beam.Filter(
-              python_callable.PythonCallableWithSource(keep)),
+          'LogForTesting': lambda: beam.Map(log_and_return),

Review Comment:
   Logging every element is certainly not to be encouraged for production 
pipelines...I might go so far as to consider it an anti-pattern. But I could 
see it being used to log bad elements or something similar. We can always add 
it later. 



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