ahmedabu98 commented on code in PR #35547:
URL: https://github.com/apache/beam/pull/35547#discussion_r2213866160


##########
sdks/python/apache_beam/transforms/ptransform.py:
##########
@@ -1027,11 +1027,18 @@ def expand(self, pcoll):
       pass
     return self._fn(pcoll, *args, **kwargs)
 
-  def default_label(self):
+  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.
     if self._args:
-      return '%s(%s)' % (
-          label_from_callable(self._fn), label_from_callable(self._args[0]))
-    return label_from_callable(self._fn)
+      first_arg_string = label_from_callable(self._args[0])
+      suffix = '(%s)' % first_arg_string if len(first_arg_string) <= 16 else ''

Review Comment:
   could we just truncate instead of returning an empty string?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to