You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/07/14 11:22:57 UTC

[GitHub] [beam] InigoSJ commented on a change in pull request #12074: [BEAM-10313] Add without_defaults to built-in Combiners in Python

InigoSJ commented on a change in pull request #12074:
URL: https://github.com/apache/beam/pull/12074#discussion_r454285726



##########
File path: sdks/python/apache_beam/transforms/combiners.py
##########
@@ -62,26 +62,28 @@
 TimestampType = Union[int, float, Timestamp, Duration]
 
 
+class CombinerWithoutDefaults(ptransform.PTransform):
+  def __init__(self, has_defaults=True):
+    self.has_defaults = has_defaults
+
+  def with_defaults(self, has_defaults=True):
+    self.has_defaults = has_defaults
+    return self

Review comment:
       This looks very nice, I wanted to return a new instance by wasn't sure how, copy is a very clever way, thanks.
   
   Commited




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org