xgbtxy opened a new pull request, #40798:
URL: https://github.com/apache/beam/pull/40798

   Fixes #19631.
   
   When every positional parameter has a default, `_get_arg_placeholders` 
counts the implicit element as a side-input slot. For `process(element=1, 
timestamp=DoFn.TimestampParam, side_input=3)`, passing side argument `2` 
produces `(element, 2, timestamp)` instead of `(element, timestamp, 2)`.
   
   Skip that first ordinary default in the implicit-element branch, so the 
existing argument-count and placeholder logic starts at the next parameter. 
Explicit `ElementParam` and leading special-marker handling are unchanged. The 
same helper fixes `process_batch`; the tests cover that path across the 
existing FnApiRunner configurations. A Python bugfix note is included in 
`CHANGES.md`.
   
   Validation on Windows/Python 3.12 with the native Cython module rebuilt 
using MSVC:
   
   - All 15 new regression/control executions pass. Before the fix, the two 
implicit-element positional/side-input cases and seven batch configurations 
fail; the six explicit/default/keyword controls pass.
   - Complete `fn_runner_test.py`: 465 passed, 81 skipped.
   - Complete common, core-transform, PTransform and runtime-typecheck modules 
with `BundleBasedDirectRunner`: 283 passed, 3 skipped, 5 failed. Rebuilding the 
exact original `common.py` reproduces all five failures in unchanged PTransform 
tests. The candidate was then restored, rebuilt and its 15 new cases rerun 
successfully.
   - Configured pre-commit checks pass on every changed Python file. 
Full-repository YAPF passes; Ruff reports the same 30 diagnostics on the 
original tree and candidate. Full Pyrefly, in the same activated environment, 
is blocked on the same two generated `.pyi` UTF-8 decoding errors on both 
versions. No unrelated lint/type-check changes were made.
   
   The public issue was also reproduced independently on both 
BundleBasedDirectRunner and FnApiRunner before the change; both now return the 
expected values. Cloud runners and other Python versions were not run locally. 
AI assistance: OpenAI Codex.
   


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