You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by pa...@apache.org on 2020/12/28 14:26:18 UTC
[beam] branch release-2.27.0 updated: Revert "Optimizes
extract_output for 1 element accumulator case. (#13220)"
This is an automated email from the ASF dual-hosted git repository.
pabloem pushed a commit to branch release-2.27.0
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/release-2.27.0 by this push:
new 391ea8e Revert "Optimizes extract_output for 1 element accumulator case. (#13220)"
new a0d7d78 Merge pull request #13613 from [BEAM-11522] Revert "Optimizes extract_output for 1 element accumulator case. (#13220)"
391ea8e is described below
commit 391ea8eec7bdac360ca72a453f237e4925fb4704
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):