Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ea9e277

Browse files
authored
[BEAM-11272] Remove combiner label constructor arg (#13355)
1 parent 7c4a21a commit ea9e277

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

sdks/python/apache_beam/transforms/combiners.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
class CombinerWithoutDefaults(ptransform.PTransform):
6767
"""Super class to inherit without_defaults to built-in Combiners."""
6868
def __init__(self, has_defaults=True):
69+
super(CombinerWithoutDefaults, self).__init__()
6970
self.has_defaults = has_defaults
7071

7172
def with_defaults(self, has_defaults=True):
@@ -802,9 +803,6 @@ def add_input(self, accumulator, element, *args, **kwargs):
802803

803804
class ToList(CombinerWithoutDefaults):
804805
"""A global CombineFn that condenses a PCollection into a single list."""
805-
def __init__(self, label='ToList'): # pylint: disable=useless-super-delegation
806-
super(ToList, self).__init__(label)
807-
808806
def expand(self, pcoll):
809807
if self.has_defaults:
810808
return pcoll | self.label >> core.CombineGlobally(ToListCombineFn())
@@ -838,9 +836,6 @@ class ToDict(CombinerWithoutDefaults):
838836
If multiple values are associated with the same key, only one of the values
839837
will be present in the resulting dict.
840838
"""
841-
def __init__(self, label='ToDict'): # pylint: disable=useless-super-delegation
842-
super(ToDict, self).__init__(label)
843-
844839
def expand(self, pcoll):
845840
if self.has_defaults:
846841
return pcoll | self.label >> core.CombineGlobally(ToDictCombineFn())
@@ -873,9 +868,6 @@ def extract_output(self, accumulator):
873868

874869
class ToSet(CombinerWithoutDefaults):
875870
"""A global CombineFn that condenses a PCollection into a set."""
876-
def __init__(self, label='ToSet'): # pylint: disable=useless-super-delegation
877-
super(ToSet, self).__init__(label)
878-
879871
def expand(self, pcoll):
880872
if self.has_defaults:
881873
return pcoll | self.label >> core.CombineGlobally(ToSetCombineFn())

0 commit comments

Comments
 (0)