jason810496 opened a new pull request, #69757:
URL: https://github.com/apache/airflow/pull/69757
## Why
`@task.stub` tasks can only be declared argless today, so a Go task that
needs an upstream's output has to hand-write `GetXCom` calls (with the upstream
`task_id` hard-coded in Go, duplicating the wiring the Dag file already
expresses). This PR makes the natural TaskFlow call work across the language
boundary:
```python
@task.stub(queue="golang")
def transform(country: str, extracted: dict): ...
with DAG(...):
transform("uk", extract()) # extract() is a normal Python @task
```
```go
// The runtime binds "uk" onto country and pulls extract's XCom into
extracted.
func transform(ctx sdk.TIRunContext, log *slog.Logger, country string,
extracted map[string]any) error
```
## What
- **Parse time (providers/standard):** `_StubOperator` binds the TaskFlow
call to the stub's signature and serializes an ordered positional-arg spec with
the Dag (`_arg_bindings`): each entry is an XCom reference or a JSON literal,
with `data_type` derived from the parameter annotation.
- **Server (execution API):** `ti_run` returns the spec as a new optional
`TIRunContext.arg_bindings` field — extracted from the serialized-dag blob only
for `_StubOperator` tasks, and stripped for older API versions (Cadwyn change
in the in-progress `2026-06-30` block). The supervisor needs zero changes
because `TIRunContext` is embedded verbatim in `StartupDetails`.
- **Supervisor schema:** new in-progress version `2026-07-30`
(`AddArgBindingsToTIRunContext`); the downgrade path strips the field, so
bundles pinned to `2026-06-16` keep working unchanged.
- **Go SDK:** new `pkg/binding` package. `Analyze` classifies parameters
once at registration (injectables like `context.Context`/`*slog.Logger` vs
JSON-decodable *data parameters*); `Resolve` binds the spec onto the data
parameters in order — literals decode directly, XCom entries pull on demand.
Arity or declared-type mismatches fail the task loudly before the body runs,
replacing the old silent `reflect.Zero` fill.
- Fail-loud v1 exclusions at parse time: `.expand()`/`.partial()` (via a new
generic `supports_expand` opt-out), `map`/`zip`/`concat` XComArgs,
`*args`/`**kwargs`, context-key parameter names, and non-JSON-serializable
literals.
---
##### Was generative AI tooling used to co-author this PR?
- [x] Yes, with help of Claude Code (Fable 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]