xgbtxy commented on code in PR #40798:
URL: https://github.com/apache/beam/pull/40798#discussion_r4397171794


##########
sdks/python/apache_beam/runners/common.py:
##########
@@ -717,8 +717,11 @@ def __init__(self, placeholder):
       self.placeholder = placeholder
 
   if all(core.DoFn.ElementParam != arg for arg in default_arg_values):
-    # TODO(https://github.com/apache/beam/issues/19631): Handle cases in which
-    #   len(arg_names) == len(default_arg_values).
+    if (default_arg_values and len(arg_names) == len(default_arg_values) and
+        not isinstance(default_arg_values[0], core._DoFnParam) and
+        default_arg_values[0] is not core.DoFn.BundleFinalizerParam):
+      # The implicit element occupies the first slot even if it has a default.
+      default_arg_values = default_arg_values[1:]

Review Comment:
   Added the `if default_arg_values:` guard in 
[0dbcf73](https://github.com/apache/beam/commit/0dbcf731ed20388b3343328e7d6e1c27e3748a06).
 This skips the `-0` slice when no defaults remain.
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to