Register custom deadline references via plugins, matching timetable pattern#66737
Merged
vatsrahul1001 merged 2 commits intoMay 18, 2026
Conversation
…attern Align custom deadline reference resolution with the existing timetable / partition-mapper plugin pattern. Adds a new `deadline_references` attribute to `AirflowPlugin` and a matching `find_registered_custom_deadline_reference` helper. `SerializedCustomReference.deserialize_reference()` now resolves class paths through the registry instead of `import_string()` on the serialized payload. Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
892f390 to
0cf70f2
Compare
Member
Author
|
I'd love to get this one merged — and would love it in 3.2.2 if it's not too late. cc @vatsrahul1001 (3.2.2 RM) Drafted-by: Claude Code (Opus 4.7); reviewed by @potiuk before posting |
Lee-W
approved these changes
May 18, 2026
Contributor
Backport successfully created: v3-2-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
github-actions Bot
pushed a commit
to aws-mwaa/upstream-to-airflow
that referenced
this pull request
May 18, 2026
… timetable pattern (apache#66737) * Register custom deadline references via plugins, matching timetable pattern Align custom deadline reference resolution with the existing timetable / partition-mapper plugin pattern. Adds a new `deadline_references` attribute to `AirflowPlugin` and a matching `find_registered_custom_deadline_reference` helper. `SerializedCustomReference.deserialize_reference()` now resolves class paths through the registry instead of `import_string()` on the serialized payload. Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions * Add newsfragment for deadline-references plugin migration (cherry picked from commit 6b0ccd3) Co-authored-by: Jarek Potiuk <jarek@potiuk.com> Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https: //github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
aws-airflow-bot
pushed a commit
to aws-mwaa/upstream-to-airflow
that referenced
this pull request
May 18, 2026
… timetable pattern (apache#66737) * Register custom deadline references via plugins, matching timetable pattern Align custom deadline reference resolution with the existing timetable / partition-mapper plugin pattern. Adds a new `deadline_references` attribute to `AirflowPlugin` and a matching `find_registered_custom_deadline_reference` helper. `SerializedCustomReference.deserialize_reference()` now resolves class paths through the registry instead of `import_string()` on the serialized payload. Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions * Add newsfragment for deadline-references plugin migration (cherry picked from commit 6b0ccd3) Co-authored-by: Jarek Potiuk <jarek@potiuk.com> Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https: //github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
vatsrahul1001
pushed a commit
that referenced
this pull request
May 18, 2026
… timetable pattern (#66737) (#67098) * Register custom deadline references via plugins, matching timetable pattern Align custom deadline reference resolution with the existing timetable / partition-mapper plugin pattern. Adds a new `deadline_references` attribute to `AirflowPlugin` and a matching `find_registered_custom_deadline_reference` helper. `SerializedCustomReference.deserialize_reference()` now resolves class paths through the registry instead of `import_string()` on the serialized payload. Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions * Add newsfragment for deadline-references plugin migration (cherry picked from commit 6b0ccd3) Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https: //github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
vatsrahul1001
pushed a commit
that referenced
this pull request
May 20, 2026
… timetable pattern (#66737) (#67098) * Register custom deadline references via plugins, matching timetable pattern Align custom deadline reference resolution with the existing timetable / partition-mapper plugin pattern. Adds a new `deadline_references` attribute to `AirflowPlugin` and a matching `find_registered_custom_deadline_reference` helper. `SerializedCustomReference.deserialize_reference()` now resolves class paths through the registry instead of `import_string()` on the serialized payload. Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions * Add newsfragment for deadline-references plugin migration (cherry picked from commit 6b0ccd3) Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https: //github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
vatsrahul1001
pushed a commit
that referenced
this pull request
May 20, 2026
… timetable pattern (#66737) (#67098) * Register custom deadline references via plugins, matching timetable pattern Align custom deadline reference resolution with the existing timetable / partition-mapper plugin pattern. Adds a new `deadline_references` attribute to `AirflowPlugin` and a matching `find_registered_custom_deadline_reference` helper. `SerializedCustomReference.deserialize_reference()` now resolves class paths through the registry instead of `import_string()` on the serialized payload. Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions * Add newsfragment for deadline-references plugin migration (cherry picked from commit 6b0ccd3) Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https: //github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
vatsrahul1001
pushed a commit
that referenced
this pull request
May 21, 2026
… timetable pattern (#66737) (#67098) * Register custom deadline references via plugins, matching timetable pattern Align custom deadline reference resolution with the existing timetable / partition-mapper plugin pattern. Adds a new `deadline_references` attribute to `AirflowPlugin` and a matching `find_registered_custom_deadline_reference` helper. `SerializedCustomReference.deserialize_reference()` now resolves class paths through the registry instead of `import_string()` on the serialized payload. Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions * Add newsfragment for deadline-references plugin migration (cherry picked from commit 6b0ccd3) Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https: //github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Align custom deadline reference resolution with the existing plugin-registration pattern already used by timetables and partition mappers.
Before this change,
SerializedCustomReference.deserialize_reference()resolved class paths viaimport_string()on the serialized__class_pathvalue. After this change, custom deadline reference classes have to be registered via the newdeadline_referencesattribute onAirflowPlugin, the same way custom timetables and custom partition mappers are registered.Files changed
shared/plugins_manager/.../plugins_manager.py— newAirflowPlugin.deadline_referencesattribute.airflow-core/.../plugins_manager.py— newget_deadline_references_plugins().airflow-core/.../serialization/helpers.py— newDeadlineReferenceNotRegisteredexception andfind_registered_custom_deadline_reference().airflow-core/.../serialization/definitions/deadline.py—SerializedCustomReference.deserialize_reference()now uses the registry.airflow-core/tests/unit/serialization/test_deadline_reference_registry.py— new tests covering registry hit/miss + serialization round-trip.airflow-core/docs/administration-and-deployment/plugins.rst— document the new attribute.Migration
Any project relying on inline DAG-author-defined custom deadline references will need to migrate to a registered plugin class. Core deadlines (
FixedDatetimeDeadline,DagRunLogicalDateDeadline,DagRunQueuedAtDeadline,AverageRuntimeDeadline) are unaffected.Test plan
uv run --project airflow-core pytest airflow-core/tests/unit/serialization/test_deadline_reference_registry.py -xvsuv run --project airflow-core pytest airflow-core/tests/unit/models/test_deadline.py -xvsprek run --from-ref upstream/main --stage pre-commituv run --project airflow-core --with "apache-airflow-devel-common[mypy]" mypy airflow-core/src/airflow/serialization/Was generative AI tooling used to co-author this PR?
Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions