Rename dagrun update state - #71347
Closed
fat-catTW wants to merge 1 commit into
Closed
Conversation
fat-catTW
requested review from
XD-DENG,
amoghrajesh,
ashb,
ephraimbuddy and
kaxil
as code owners
August 9, 2026 17:31
Member
|
The PR title and description should be updated to reflect the scope this PR touches. I would not expect the rename to trigger database migrations. |
fat-catTW
force-pushed
the
rename-dagrun-update-state
branch
from
August 10, 2026 06:04
9878dc2 to
c30e674
Compare
Contributor
Author
|
Thanks for the review. I rebased I also updated the description. |
Member
|
It does way more than just scheduling, I don't see a motivation for the rename |
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.
Rename the internal DagRun scheduling decision method from
update_state()toschedule_dag_run().This PR only changes the Python method name used when the scheduler advances a DagRun through one scheduling decision pass. The method still performs the same work as before: evaluating task instances, returning schedulable TIs, updating the DagRun state when appropriate, and preparing callbacks.
Tests were updated to use the new name, and the compatibility alias is covered to ensure calls without an explicit session still receive one via
@provide_session.Scope:
DagRun.update_state()implementation toDagRun.schedule_dag_run().DagRun.update_state()as a compatibility alias.dag.test(), and DagRun-related tests to callschedule_dag_run().update_stateAPIs untouched, including TaskInstance Execution API state updates and connection test state updates.Tests run:
uv run ruff format airflow-core/src/airflow/models/dagrun.py airflow-core/tests/unit/models/test_dagrun.pyuv run ruff check --fix airflow-core/src/airflow/models/dagrun.py airflow-core/tests/unit/models/test_dagrun.pyuv run --project airflow-core pytest airflow-core/tests/unit/models/test_dagrun.py::TestDagRun::test_update_state_delegates_to_schedule_dag_run -xvsuv run --project airflow-core pytest airflow-core/tests/unit/models/test_dagrun.py::TestDagRun::test_schedule_dag_run_one_unfinished airflow-core/tests/unit/models/test_dag.py::TestDag::test_dag_paused_after_limit_orders_by_run_after -xvsuv run --project airflow-core pytest airflow-core/tests/unit/jobs/test_scheduler_job.py::TestSchedulerJob::test_update_dagrun_state_for_paused_dag airflow-core/tests/unit/jobs/test_scheduler_job.py::TestSchedulerJob::test_update_dagrun_state_for_paused_dag_not_for_backfill -xvsWas generative AI tooling used to co-author this PR?
[X]Yes (please specify the tool below)Generated-by: [Codex] following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.