Pebble32 commented on issue #76370:
URL: https://github.com/apache/airflow/issues/76370#issuecomment-6980899196
Spent some time using the SDK and it feels solid overall, the error messages
in particular are really good. A few things I ran into, happy to open PRs for
any of them:
1. Task inputs are not type checked against upstream outputs. `TaskInputs`
accepts a bare `TaskRef`, so passing `TaskRef<string>` to a `number` input
compiles and the task gets `NaN` at runtime. From the history it looks like the
typed path was dropped when inputs became named only (#73437), since ADR 0002
says tsc checks every named input. Typing it as
`TaskRef<ReadonlyDeep<TArgs[K]>>` fixes it, with `unknown` still working as an
opt-out. Same for `dag.if`, `dag.switch` and `triggerDagRun`. If loose refs
were intentional, it would be good to note why in the ADR.
2. Return values aren't restricted to JSON compatible types, so a returned
`Map` or `Set` silently arrives downstream as `{}`. A runtime check is an easy
fix, but would you also want `TReturn` constrained at the type level? That
could break some existing code.
3. Some smaller things: there's no way to skip a task or fail it without
retries, and `TaskContext` doesn't expose `logicalDate` or the data interval
even though they're sent to the runtime. Would PRs for these be welcome, or are
they planned already?
Separately, an out of range cron like `0 25 * * *` passes `airflow-ts-pack`
and the Dag import, and the Dag just never runs. I'll open a separate issue for
that one.
--
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]