robertwb commented on a change in pull request #12802:
URL: https://github.com/apache/beam/pull/12802#discussion_r487323666



##########
File path: sdks/python/apache_beam/transforms/core.py
##########
@@ -988,10 +991,14 @@ def apply(self, elements, *args, **kwargs):
       *args: Additional arguments and side inputs.
       **kwargs: Additional arguments and side inputs.
     """
+    if args or kwargs:
+      add_input = lambda accumulator, element: self.add_input(
+          accumulator, element, *args, **kwargs)
+    else:

Review comment:
       It's for performance reasons. Most of the time args and kwargs are empty 
(and it is much cheap to not have the level of indirection or use them). 

##########
File path: sdks/python/apache_beam/transforms/core.py
##########
@@ -988,10 +991,14 @@ def apply(self, elements, *args, **kwargs):
       *args: Additional arguments and side inputs.
       **kwargs: Additional arguments and side inputs.
     """
+    if args or kwargs:
+      add_input = lambda accumulator, element: self.add_input(
+          accumulator, element, *args, **kwargs)
+    else:

Review comment:
       It's for performance reasons. Most of the time args and kwargs are empty 
(and it is much cheap to not have the level of indirection or use them). 

##########
File path: sdks/python/apache_beam/transforms/core.py
##########
@@ -988,10 +991,14 @@ def apply(self, elements, *args, **kwargs):
       *args: Additional arguments and side inputs.
       **kwargs: Additional arguments and side inputs.
     """
+    if args or kwargs:
+      add_input = lambda accumulator, element: self.add_input(
+          accumulator, element, *args, **kwargs)
+    else:

Review comment:
       It's for performance reasons. Most of the time args and kwargs are empty 
(and it is much cheap to not have the level of indirection or use them). 

##########
File path: sdks/python/apache_beam/transforms/core.py
##########
@@ -988,10 +991,14 @@ def apply(self, elements, *args, **kwargs):
       *args: Additional arguments and side inputs.
       **kwargs: Additional arguments and side inputs.
     """
+    if args or kwargs:
+      add_input = lambda accumulator, element: self.add_input(
+          accumulator, element, *args, **kwargs)
+    else:

Review comment:
       It's for performance reasons. Most of the time args and kwargs are empty 
(and it is much cheap to not have the level of indirection or use them). 

##########
File path: sdks/python/apache_beam/transforms/core.py
##########
@@ -988,10 +991,14 @@ def apply(self, elements, *args, **kwargs):
       *args: Additional arguments and side inputs.
       **kwargs: Additional arguments and side inputs.
     """
+    if args or kwargs:
+      add_input = lambda accumulator, element: self.add_input(
+          accumulator, element, *args, **kwargs)
+    else:

Review comment:
       It's for performance reasons. Most of the time args and kwargs are empty 
(and it is much cheap to not have the level of indirection or use them). 

##########
File path: sdks/python/apache_beam/transforms/core.py
##########
@@ -988,10 +991,14 @@ def apply(self, elements, *args, **kwargs):
       *args: Additional arguments and side inputs.
       **kwargs: Additional arguments and side inputs.
     """
+    if args or kwargs:
+      add_input = lambda accumulator, element: self.add_input(
+          accumulator, element, *args, **kwargs)
+    else:

Review comment:
       It's for performance reasons. Most of the time args and kwargs are empty 
(and it is much cheap to not have the level of indirection or use them). 

##########
File path: sdks/python/apache_beam/transforms/core.py
##########
@@ -988,10 +991,14 @@ def apply(self, elements, *args, **kwargs):
       *args: Additional arguments and side inputs.
       **kwargs: Additional arguments and side inputs.
     """
+    if args or kwargs:
+      add_input = lambda accumulator, element: self.add_input(
+          accumulator, element, *args, **kwargs)
+    else:

Review comment:
       It's for performance reasons. Most of the time args and kwargs are empty 
(and it is much cheap to not have the level of indirection or use them). 

##########
File path: sdks/python/apache_beam/transforms/core.py
##########
@@ -988,10 +991,14 @@ def apply(self, elements, *args, **kwargs):
       *args: Additional arguments and side inputs.
       **kwargs: Additional arguments and side inputs.
     """
+    if args or kwargs:
+      add_input = lambda accumulator, element: self.add_input(
+          accumulator, element, *args, **kwargs)
+    else:

Review comment:
       It's for performance reasons. Most of the time args and kwargs are empty 
(and it is much cheap to not have the level of indirection or use them). 




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to