You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jason810496 (via GitHub)" <gi...@apache.org> on 2026/09/15 12:01:17 UTC
[PR] TS SDK: add withArgNames for explicit argument renames [airflow]
jason810496 opened a new pull request, #73191:
URL: https://github.com/apache/airflow/pull/73191
- related ADR: `ts-sdk/adr/0001-mixed-lang-dag-interface.md` (decision 5)
- **Depends on `feature/ts-sdk/taskflow-xcom-args` get merged first** (only the last commit is new here).
- **Diff for early review**: https://github.com/jason810496/airflow/compare/feature/ts-sdk/taskflow-xcom-args...feature/ts-sdk/with-arg-names
## Why
Folding absorbs spelling differences, but not a name the Python side never used:
a handler that wants to call `run_label` simply `label`, or one whose argument is a TypeScript reserved word like `enum`.
## How
- `withArgNames(map, handler)`, mapping first. An entry beats folding, and everything the map does not mention still folds,
which is what keeps this rare in a real Dag.
- The map's keys are checked against the handler's own parameter type, so `{ labl: "run_label" }` is a compile error naming the right key.
Its type parameter is `NoInfer`, so the parameter type comes from the handler alone;
inferring it from the map too would make every key correct by construction and the check vacuous.
The values are Python names, which `tsc` cannot see and does not check.
- A mapped name the call did not pass misses rather than falling back to folding,
so a stated binding that is wrong is visible instead of silently replaced by a guess.
The unbound-argument warning now also names the wire name that was asked for.
- The renames travel with the handler on a global symbol and are read back at the dispatch site.
The return value is a wrapper rather than the author's own function with a property attached,
because one handler can be registered for two tasks that rename differently.
- The shipped example gains a `report` task whose handler renames `run_label` to `label` and throws unless it bound correctly,
so a rename that did not take effect fails the end-to-end run rather than returning a null.
---
##### 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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] TS SDK: add withArgNames for explicit argument renames [airflow]
Posted by "jason810496 (via GitHub)" <gi...@apache.org>.
jason810496 merged PR #73191:
URL: https://github.com/apache/airflow/pull/73191
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org