You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by tv...@apache.org on 2020/12/24 01:03:06 UTC

[beam] 01/01: Revert "Optimizes extract_output for 1 element accumulator case. (#13220)"

This is an automated email from the ASF dual-hosted git repository.

tvalentyn pushed a commit to branch revert-13220-patch_cl_339240878
in repository https://gitbox.apache.org/repos/asf/beam.git

commit 754a25f2b4354db0e31928ef55f293920bfad038
Author: tvalentyn <tv...@users.noreply.github.com>
AuthorDate: Wed Dec 23 17:02:11 2020 -0800

    Revert "Optimizes extract_output for 1 element accumulator case. (#13220)"
    
    This reverts commit 34e27ba1dd6ec8886d0df7e5fcd3600fd64db914.
---
 sdks/python/apache_beam/transforms/core.py | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/sdks/python/apache_beam/transforms/core.py b/sdks/python/apache_beam/transforms/core.py
index ba29b7d..1f48c5f 100644
--- a/sdks/python/apache_beam/transforms/core.py
+++ b/sdks/python/apache_beam/transforms/core.py
@@ -1075,10 +1075,7 @@ class CallableWrapperCombineFn(CombineFn):
       return [self._fn(accumulator, *args, **kwargs)]
 
   def extract_output(self, accumulator, *args, **kwargs):
-    if len(accumulator) == 1:
-      return accumulator[0]
-    else:
-      return self._fn(accumulator, *args, **kwargs)
+    return self._fn(accumulator, *args, **kwargs)
 
   def default_type_hints(self):
     fn_hints = get_type_hints(self._fn)
@@ -1155,10 +1152,7 @@ class NoSideInputsCallableWrapperCombineFn(CallableWrapperCombineFn):
       return [self._fn(accumulator)]
 
   def extract_output(self, accumulator):
-    if len(accumulator) == 1:
-      return accumulator[0]
-    else:
-      return self._fn(accumulator)
+    return self._fn(accumulator)
 
 
 class PartitionFn(WithTypeHints):