jason810496 opened a new pull request, #73648:
URL: https://github.com/apache/airflow/pull/73648

   - related: 
[ADR-0006](https://github.com/apache/airflow/blob/main/go-sdk/adr/0006-cross-language-argument-binding.md),
 [lang-SDK 
ADR-0007](https://github.com/apache/airflow/blob/main/airflow-core/adr/lang-sdk/0007-taskflow-across-language-boundary.md)
   - related: #71188 (Java SDK), and the TS SDK side in a sibling PR
   
   ## Why
   
   Sole-struct binding fails the task when an argument no field claims arrives, 
but silently zero-fills a field no argument supplies. Nothing checks the stub 
signature against the Go one, so both are the same kind of mismatch, and 
neither is worth failing a run over when fields bind by name.
   
   ## How
   
   Fields bind by name like keyword arguments, so neither direction shifts 
anything the handler reads. Both are now logged before the task runs, and the 
task runs. A call can be wrong both ways at once, so each direction is its own 
message:
   
   - `Dag's call passed argument(s) the task handler does not declare`
   - `Task handler declares argument(s) the Dag's call did not pass`
   
   The same two strings are used by every lang SDK, so one query finds them 
across languages. Captured defaults are not reported, as before.
   
   ```go
   type ReportInput struct {
       Region    string `arg:"region_code"`
       Threshold float64
   }
   ```
   
   ```python
   report(region_code=region)  # no threshold
   # Threshold stays 0.0, warned: Task handler declares argument(s) the Dag's 
call did not pass
   
   report(region_code=region, threshold=0.75, extra="x")
   # before: task fails on the unclaimed "extra"
   # now:    warned, task runs
   ```
   
   Unchanged: flat positional bindings still fail either way, because a dropped 
or added positional argument shifts every later one. A spec that arrives empty 
against a struct with bindable fields also still fails, since that is an 
absence rather than a mismatch.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes, with help of Claude Code Opus 5 following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


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