jason810496 opened a new pull request, #73188: URL: https://github.com/apache/airflow/pull/73188
- related ADR: `ts-sdk/adr/0001-mixed-lang-dag-interface.md` (decisions 1 and 3) - **Depends on `refactor/ts-sdk/bundle-registration` get merged first** (only the last commit is new here). - **Diff for early review**: https://github.com/jason810496/airflow/compare/refactor/ts-sdk/bundle-registration...feature/ts-sdk/task-handler-class - **next**: `feature/ts-sdk/taskflow-arg-folding` ## Why A mixed-language Dag is declared in Python, but the only way to attach a handler was `new Dag(dagId)` plus `dag.task(...)`, so every such bundle constructed a Dag object for a Dag it does not own. ## How - `new TaskHandler(dagId, taskId, handler)` binds a function to the Python-owned task it implements and carries nothing else: no schedule, no task order, no dag_id of its own. Both ids are written out, so nothing depends on a function name a bundler may rename. - `Dag` becomes exclusively the native case. A dag_id is one or the other: registering a handler for a natively declared Dag is rejected, rather than becoming a second, disagreeing source for its task list. - A handler is a value with no call signature, so wiring one the way a native task is wired does not type-check. That is the guarantee an earlier draft's separate `MixedLangDag` class existed to provide. - `Registerable` gains its second arm rather than the bundle gaining a second verb, so one `register` call still lists everything in any mixture. A bundle now holds one entry per dag_id and dispatches on the `(dag_id, task_id)` pair, so one bundle can provide for several Dags. - The shipped example drops `Dag` entirely. A second Python-owned Dag joins it, sharing a `build_message` task_id with the first on purpose, and the end-to-end test asserts each reached its own handler. A bundle keyed on the task id alone would answer both from whichever was registered last. --- ##### 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]
