chamikaramj commented on code in PR #41383:
URL: https://github.com/apache/beam/pull/41383#discussion_r4618701002


##########
sdks/python/apache_beam/yaml/yaml_combine.py:
##########
@@ -157,9 +160,16 @@ def extract_return_type(expr):
       # TODO(yaml): See if this logic can be pushed into GroupBy itself.
       expr_type = extract_return_type(expr)
       if isinstance(fn, beam.CombineFn):

Review Comment:
   This changes the coder so would break streaming compatibility for Dataflow. 
Let's guard with `pcoll.pipeline.options.is_compat_version_prior_to('2.79.0')` 
keep the old behavior if this is true. We have a similar guard at the following 
location so you can follow the same pattern.
   
   
https://github.com/apache/beam/blob/c9713e7166ba2ed399678c96e4ad5d22d8b565f8/sdks/python/apache_beam/typehints/native_type_compatibility.py#L215
   
   



##########
sdks/python/apache_beam/yaml/yaml_combine.py:
##########
@@ -128,9 +129,11 @@ def create_combine_fn(fn_spec):
             fn_spec['type'])
         if 'config' in fn_spec:
           fn = fn(**fn_spec['config'])
+        elif isinstance(fn, type) and issubclass(fn, beam.CombineFn):

Review Comment:
   This seems to be more than a an addition to type hints since we are 
extending the set of cases where a combine fn can be deducted. Could you add a 
comment and update the PR description accordingly. Also, good to try a Dataflow 
pipeline end-to-end to confirm that this is needed.



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