damccorm commented on code in PR #28546:
URL: https://github.com/apache/beam/pull/28546#discussion_r1334965139
##########
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:
Agreed on all fronts, the log on a certain branch path does seem useful to
me. I also kinda think that if you use something named "Log" you'll know what
you're getting, and naming it "LogForTesting" doesn't really discourage use.
I'm fine deferring this though
--
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]