jason810496 commented on code in PR #73243:
URL: https://github.com/apache/airflow/pull/73243#discussion_r4026292029
##########
ts-sdk/adr/0002-native-dag-interface.md:
##########
@@ -90,6 +92,24 @@ One statement per task, with each ref named, is the form to
write. Nesting the c
shorthand for a two-task chain, not the general shape: a Dag of twenty tasks
reads as twenty flat
statements, never as a twenty-deep expression.
+### Omitting the task id
+
+A native task defaults its id to the handler's function name, so a named
handler needs none:
+
+```ts
+const extract = dag.task(async function extract(): Promise<number> {
+ return 42;
+});
+// task id "extract"
+```
+
+The id comes from the handler's *source* name, resolved when the bundle is
packed and written into
+the registration — not from `handler.name` at runtime, which minification
renames (see
Review Comment:
Could we also add the example of user explicitly setting the taskId, it
would be set on the `TaskSpec` like Go SDK (though I still updating the ADR,
couldn't point the link to it right away).
--
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]