Skip to content

Commit 8e242f9

Browse files
authored
Revert "Avoid unreasonably long stage names for @ptransform_fn. (#35547)" (#35622)
This reverts commit d4d99a1.
1 parent 4390063 commit 8e242f9

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

sdks/python/apache_beam/transforms/ptransform.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,18 +1030,11 @@ def expand(self, pcoll):
10301030
pass
10311031
return self._fn(pcoll, *args, **kwargs)
10321032

1033-
def default_label(self) -> str:
1034-
# Attempt to give a reasonable name to this transform.
1035-
# We want it to be reasonably unique, but also not sensitive to
1036-
# irrelevent parameters to minimize pipeline-to-pipeline variance.
1037-
# For now, use only the first argument (if any), iff it would not make
1038-
# the name unwieldy.
1033+
def default_label(self):
10391034
if self._args:
1040-
first_arg_string = label_from_callable(self._args[0])
1041-
suffix = '(%s)' % first_arg_string if len(first_arg_string) <= 16 else ''
1042-
else:
1043-
suffix = ''
1044-
return label_from_callable(self._fn) + suffix
1035+
return '%s(%s)' % (
1036+
label_from_callable(self._fn), label_from_callable(self._args[0]))
1037+
return label_from_callable(self._fn)
10451038

10461039

10471040
def ptransform_fn(fn):

0 commit comments

Comments
 (0)