pierrejeambrun commented on code in PR #73437:
URL: https://github.com/apache/airflow/pull/73437#discussion_r4133417889
##########
ts-sdk/adr/0002-native-dag-interface.md:
##########
@@ -149,20 +145,23 @@ convention.
by design. Native declaration is what fills them, generated from the
serialized-Dag JSON schema the
way `src/generated/supervisor.ts` is. This ADR does not choose those fields;
it fixes where an
author writes them.
-- `TaskOptions` carries the spec and the handler's positional argument names,
which the packer fills in
- from the parameter list so the Dag names each argument as its handler does.
With wiring moved to the
- factory call, `inputs` is no longer an option.
+- `TaskOptions` carries the task's spec and nothing else: the names on the
wire are the keys of the
+ call itself. With wiring moved to the factory call, `inputs` is no longer an
option.
- `TaskHandlerArgs` is removed from the public API, `DagRegistry` becomes
`Bundle`, and
`serveDags(registry)` becomes `bundle.serve()`, which breaks
0.1.0-beta1 authors; see [ADR-0001](0001-mixed-lang-dag-interface.md) for
the shipped call sites
that change.
## Alternatives
-- **Named-only wiring**, rejected in the review on #73435: naming every input
reads well at twenty
- tasks but forces an object around a single argument, and positional calls
are what TypeScript
- authors write. Both are offered, and the handler's own parameter list
decides which one a task can
- use.
+- **Positional handlers**, `async (rows: number, region: string) => ...`,
offered first and then
+ dropped: a positional parameter list has no names on the wire unless the SDK
reads them out of the
+ handler's source, and a single object of named arguments is what a
TypeScript library takes
+ anyway.
+- **Positional call sites**, `transform(withArgList(extracted, "us"))`,
dropped in review. The values
+ were bound by the order of the handler's destructuring pattern, read from
the function's source, so
+ only a plain pattern could be called that way, and the compiler could not
catch swapped values such
+ as `withArgList("us", extracted)`. It can be added later without changing
the named form.
Review Comment:
withArgList references
--
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]