jason810496 opened a new pull request, #68311:
URL: https://github.com/apache/airflow/pull/68311
- closes: #66937
- related: #66332
## Why
A Go task could only read upstream XComs by calling the `client` explicitly
without this PR's changes, matching the Java SDK's TaskFlow shape (#66332).
## How
- A task parameter that is a struct (or pointer to one) whose exported
fields carry an `xcom:"<task_id>[,key=<key>]"` tag is treated as an XCom-input
struct: at execution the runtime pulls each field from the named upstream in
the current dag run and decodes it into the field's type. Binding lives on the
function, not the registry, so `AddTask` is unchanged.
- Decoding is strict by type: a dedicated struct field rejects
unknown/renamed keys (no silent zero-fill), while a `map[string]any`/`any`
field decodes loosely; a null value is only accepted by a nilable field.
Signature/tag mistakes fail at registration.
- The reflection/resolution logic lives in a new leaf package `pkg/binding`
(shared by the coordinator and Edge-worker paths), keeping `bundlev1/task.go`
thin.
## What
- `pkg/binding`: new `Plan` / `Analyze` / `Resolve` API for parameter
analysis, XCom pull, and strict decode
- `pkg/execution` coordinator fixes uncovered while wiring the example
end-to-end:
- `GetXCom` maps a null supervisor response to `sdk.XComNotFound` (mirrors
the HTTP 404 mapping and `xcom_pull` returning `None`).
- request frames encode user values with `json` struct tags so a typed
XCom round-trips
- log records set the reserved `timestamp`/`event`/`level` fields last so
a user attribute can't corrupt the frame the supervisor parses. (Caught by
`main.go` example when using `timestamp` as XCom field name)
- Example bundle rewritten to TaskFlow style
---
##### Was generative AI tooling used to co-author this PR?
- [x] Yes, with help of Claude Code (Opus 4.7) 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]