You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by xq...@apache.org on 2025/07/17 21:37:22 UTC
(beam) branch revert-35547-ptransform-fn-stage-name created (now 6cce81ad04d)
This is an automated email from the ASF dual-hosted git repository.
xqhu pushed a change to branch revert-35547-ptransform-fn-stage-name
in repository https://gitbox.apache.org/repos/asf/beam.git
at 6cce81ad04d Revert "Avoid unreasonably long stage names for @ptransform_fn. (#35547)"
This branch includes the following new commits:
new 6cce81ad04d Revert "Avoid unreasonably long stage names for @ptransform_fn. (#35547)"
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(beam) 01/01: Revert "Avoid unreasonably long stage names for @ptransform_fn. (#35547)"
Posted by xq...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xqhu pushed a commit to branch revert-35547-ptransform-fn-stage-name
in repository https://gitbox.apache.org/repos/asf/beam.git
commit 6cce81ad04d020c397743d98101916dc4b0e43cb
Author: liferoad <hu...@gmail.com>
AuthorDate: Thu Jul 17 17:37:17 2025 -0400
Revert "Avoid unreasonably long stage names for @ptransform_fn. (#35547)"
This reverts commit d4d99a1d76fd1782c972f73312d16012ad0c9af3.
---
sdks/python/apache_beam/transforms/ptransform.py | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/sdks/python/apache_beam/transforms/ptransform.py b/sdks/python/apache_beam/transforms/ptransform.py
index 50b04e93cad..c4f0e3455d4 100644
--- a/sdks/python/apache_beam/transforms/ptransform.py
+++ b/sdks/python/apache_beam/transforms/ptransform.py
@@ -1030,18 +1030,11 @@ class _PTransformFnPTransform(PTransform):
pass
return self._fn(pcoll, *args, **kwargs)
- def default_label(self) -> str:
- # Attempt to give a reasonable name to this transform.
- # We want it to be reasonably unique, but also not sensitive to
- # irrelevent parameters to minimize pipeline-to-pipeline variance.
- # For now, use only the first argument (if any), iff it would not make
- # the name unwieldy.
+ def default_label(self):
if self._args:
- first_arg_string = label_from_callable(self._args[0])
- suffix = '(%s)' % first_arg_string if len(first_arg_string) <= 16 else ''
- else:
- suffix = ''
- return label_from_callable(self._fn) + suffix
+ return '%s(%s)' % (
+ label_from_callable(self._fn), label_from_callable(self._args[0]))
+ return label_from_callable(self._fn)
def ptransform_fn(fn):