henry3260 opened a new pull request, #73549:
URL: https://github.com/apache/airflow/pull/73549
`airflow.TaskHandler` already rejects a handler whose signature the runtime
cannot call, so the mistake stops the executable as it starts rather than when
the task first runs. Two registrations still slipped through and failed much
later, or not visibly at all.
### An unusable dag_id or task_id
`TaskHandler("", "transform", fn)` was accepted. The empty id lands in the
manifest, the runtime never matches it when the supervisor asks for the task,
and the task instance is reported `removed` — so the author sees a task that
silently went missing rather than the typo that caused it. The same holds for
an id carrying characters Airflow rejects, or one past the 250-character limit.
Those rules already existed as private constants in the bundle packer, which
warns about them after the fact. They now live in `internal/airflowid` so
registration and the packer enforce one definition rather than two copies that
can drift. The packer's warnings are unchanged, which its existing tests pin.
**`..` is deliberately not part of the verdict.** The server rejects it only
when `[core] allow_double_dot_in_ids` is off, and a bundle cannot see the
configuration of a deployment it has not reached yet — rejecting it here would
refuse ids that the target Airflow accepts. The packer keeps warning about it,
and a test pins the acceptance so the omission is not mistaken for an oversight.
### A variadic task function
`func(actx airflow.Context, names ...string) error` passed the signature
check as if its `...` parameter were an ordinary `[]string`. It registered
cleanly and then panicked inside reflect the first time the supervisor ran it:
`Execute` calls the function with `Call`, which hands a variadic parameter the
slice itself instead of spreading it. No argument shape can fill a `...`
parameter on this path, so the registration can never become valid — `[]string`
takes the same values and works.
### Not in scope
- **Registration does not close at `Serve`.** ADR 0007 says registering
after `Serve` is a programming error that panics; `BundleRef` has no such guard
yet. It belongs with this work but touches the serve path and its locking, so
it is left for a follow-up.
- **An empty bundle is still accepted.** That is a bundle with no
registrations rather than an invalid one.
- **The docs still describe the signature check alone.** `go-sdk/README.md`
and the Go SDK page under `airflow-core/docs/` are being rewritten for the new
authoring surface in #73528; they gain the id and variadic rules once that
lands, rather than conflicting with it here.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Opus 5)
Generated-by: 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]