Skip to content

Fix backward compatibility for DagRunInfo partition fields - #68342

Merged
Lee-W merged 5 commits into
apache:mainfrom
bramhanandlingala:fix-68315
Jun 12, 2026
Merged

Fix backward compatibility for DagRunInfo partition fields#68342
Lee-W merged 5 commits into
apache:mainfrom
bramhanandlingala:fix-68315

Conversation

@bramhanandlingala

@bramhanandlingala bramhanandlingala commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What

This PR restores backward compatibility for custom timetables that were written against Airflow 3.1.x.

Airflow 3.2 introduced partition_date and partition_key fields in DagRunInfo. Since these fields were required, existing custom timetables constructing DagRunInfo with only run_after and data_interval raise a TypeError, causing scheduling to stop.

Why

Custom timetable DAGs fail to schedule after upgrading to Airflow 3.2.x:

DagRunInfo(
    run_after=run_after,
    data_interval=data_interval,
)

raises:

TypeError: DagRunInfo.__new__() missing 2 required positional arguments:
'partition_date' and 'partition_key'

This can result in DAGs showing an empty Next Run field and no scheduled DAG runs being created.

Changes

  • Added default None values for:

    • partition_date
    • partition_key
  • Added a regression test to verify backward compatibility with the legacy DagRunInfo constructor.

Testing

Added unit test covering construction of DagRunInfo using the pre-3.2 API and verified default values are correctly assigned to the new partition fields.

Fixes #68315

Gen-AI disclosure: I used a generative AI tool to help identify the root
cause, write tests, and draft the PR description. I reviewed, tested, and
verified all changes locally before submitting.

Was generative AI tooling used to co-author this PR?
  • Yes — Claude

Generated-by: Claude following the guidelines

@bramhanandlingala

Copy link
Copy Markdown
Contributor Author

Hi @uranusjr , @Lee-W

Can you please review the code and merge the changes. Thanks in advance.

@bramhanandlingala

Copy link
Copy Markdown
Contributor Author

Hi @uranusjr , @Lee-W

This PR addresses #68315 by restoring backward compatibility for custom timetables that construct DagRunInfo using the pre-3.2 API.

A regression test has also been added to cover this behavior.

Could someone please review the implementation and approve the pending workflows?

Can you please review the code and merge the changes. Thanks in advance.

Thank you!

@bramhanandlingala

Copy link
Copy Markdown
Contributor Author

Fixed the CI formatting issues (ruff-format and end-of-file-fixer) and pushed the updates.

Comment thread airflow-core/tests/unit/timetables/test_trigger_timetable.py Outdated

@Lee-W Lee-W left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix the blank line and then we can merge it

@Lee-W
Lee-W merged commit 36dd823 into apache:main Jun 12, 2026
77 checks passed
@boring-cyborg

boring-cyborg Bot commented Jun 12, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@eladkal eladkal added this to the Airflow 3.3.0 milestone Jun 12, 2026
@eladkal eladkal added the type:bug-fix Changelog: Bug Fixes label Jun 12, 2026
imrichardwu pushed a commit to imrichardwu/airflow that referenced this pull request Jun 16, 2026
)

Co-authored-by: AKHIL <mrakhilsai2001@gmail.com>
Co-authored-by: Wei Lee <weilee.rx@gmail.com>
dingo4dev pushed a commit to dingo4dev/airflow that referenced this pull request Jun 16, 2026
)

Co-authored-by: AKHIL <mrakhilsai2001@gmail.com>
Co-authored-by: Wei Lee <weilee.rx@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom timetable next_dagrun_info fails silently on 3.2 when DagRunInfo omits partition_date / partition_key

4 participants