Skip to content

Register custom deadline references via plugins, matching timetable pattern#66737

Merged
vatsrahul1001 merged 2 commits into
apache:mainfrom
potiuk:align-deadline-references-with-plugin-registry-pattern
May 18, 2026
Merged

Register custom deadline references via plugins, matching timetable pattern#66737
vatsrahul1001 merged 2 commits into
apache:mainfrom
potiuk:align-deadline-references-with-plugin-registry-pattern

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented May 11, 2026

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 via import_string() on the serialized __class_path value. After this change, custom deadline reference classes have to be registered via the new deadline_references attribute on AirflowPlugin, the same way custom timetables and custom partition mappers are registered.

Files changed

  • shared/plugins_manager/.../plugins_manager.py — new AirflowPlugin.deadline_references attribute.
  • airflow-core/.../plugins_manager.py — new get_deadline_references_plugins().
  • airflow-core/.../serialization/helpers.py — new DeadlineReferenceNotRegistered exception and find_registered_custom_deadline_reference().
  • airflow-core/.../serialization/definitions/deadline.pySerializedCustomReference.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 -xvs
  • uv run --project airflow-core pytest airflow-core/tests/unit/models/test_deadline.py -xvs
  • prek run --from-ref upstream/main --stage pre-commit
  • uv 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?
  • Yes — Claude Opus 4.7 (1M context)

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

@potiuk potiuk added the backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch label May 11, 2026
potiuk added 2 commits May 17, 2026 21:29
…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
@potiuk potiuk force-pushed the align-deadline-references-with-plugin-registry-pattern branch from 892f390 to 0cf70f2 Compare May 17, 2026 19:30
@potiuk
Copy link
Copy Markdown
Member Author

potiuk commented May 17, 2026

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

@potiuk potiuk added this to the Airflow 3.2.2 milestone May 17, 2026
@vatsrahul1001 vatsrahul1001 merged commit 6b0ccd3 into apache:main May 18, 2026
79 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Backport successfully created: v3-2-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-2-test PR Link

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:DAG-processing area:deadline-alerts AIP-86 (former AIP-57) area:plugins backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch kind:documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants