robertwb commented on code in PR #35660:
URL: https://github.com/apache/beam/pull/35660#discussion_r2226108004


##########
sdks/python/apache_beam/transforms/ptransform.py:
##########
@@ -1030,11 +1031,27 @@ def expand(self, pcoll):
       pass
     return self._fn(pcoll, *args, **kwargs)
 
+  def set_options(self, options):
+    # Avoid circular import.
+    from apache_beam.transforms.util import is_compat_version_prior_to
+    self._use_backwards_compatible_label = is_compat_version_prior_to(
+        options, '2.67.0')
+
   def default_label(self):
+    # 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])
+      if self._use_backwards_compatible_label or len(first_arg_string) <= 16:

Review Comment:
   The 16 is arbitrary, but might as well... Thanks. 



-- 
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