jason810496 commented on issue #69288: URL: https://github.com/apache/airflow/issues/69288#issuecomment-5099403842
> > I'd also like to remove `registerTask` and introduce `registerDags(d1, d2)` as the entrypoint. > > Before removing `registerTask`, I think we should clarify one compatibility question: does native TypeScript Dag authoring replace the existing Python `@task.stub` Dag with TypeScript handlers, or should the SDK continue supporting both modes? The existing mixed-language Dag should remain functional - the native TypeScript Dag is a new, additional feature. On top of that, the native TypeScript Dag will respect Dag-level and Task-level arguments, as well as task dependencies, defined on the native Dag side. > If both remain supported, we could keep `registerTask()` as a compatibility API and use `registerDags()` only for complete TypeScript-authored Dags. The TS SDK isn't released yet, so we're free to introduce any kind of breaking change at this point. I still lean toward removing the `registerTask` interface. The reason being that I'd like to support just one Dag authoring interface. This is also exactly why I challenged the `registerTask` design back in https://github.com/apache/airflow/pull/67908#discussion_r3471809233. It's fine to have `registerTask` in the early stage, but I'd like to collapse the interface into the `dag_instance = new Dag()`, `t1 = dag_instance.task()` style. Whether the TypeScript Dag serves a "mixed" or "native" purpose, both can be authored in the exact style we're discussing here. > I would avoid making `registerDags()` accept a special pseudo-Dag for a Python-defined Dag. This won't happen. > TypeScript does not own that Dag's schedule or dependency graph, so treating its handlers as a Dag could make the source of truth unclear. The "native Dag" here *will* own the Dag's schedule and dependency graph. It just focuses on the basics of an SDK — users can define Dag- and Task-level arguments, define each task callable, render properly on the Airflow UI, and trigger it as a normal Dag — except the whole Dag is defined in TypeScript. -- 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]
