Uh oh!
There was an error while loading. Please reload this page.
Remove logical_date from DAG Run APIs and Functions, transition to run_id as sole identifier for Airflow 3.0 - #42404
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
3e729bc to
efa47f6Compare8be76b2 to
ef1b914CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
sunank200
commented
Nov 11, 2024
The following PR: #43902 renames the |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…API is used to look up a DAG run Remove execution_date and logical_date from arguments where function/API is used to look up a DAG run - Resolve compatibility issues and refactor `execution_date` to `logical_date` - Resolve compatibility tests - Correct import paths after rebase - Address static checks - Refactor `execution_date` to `logical_date` - Add missing DAG files for tests - Enhance GCP ML and CloudBuild tests using helpers for compatibility - Fix mypy errors - Miscellaneous fixes and removals of `execution_date` - Resolve compatibility tests - Correct import paths after rebase - Address static checks - Refactor `execution_date` to `logical_date` - Add missing DAG files for tests - Enhance GCP ML and CloudBuild tests using helpers for compatibility - Fix mypy errors - Miscellaneous fixes and removals of `execution_date` - Resolve compatibility tests - Correct import paths after rebase - Address static checks - Refactor `execution_date` to `logical_date` - Add missing DAG files for tests - Enhance GCP ML and CloudBuild tests using helpers for compatibility - Fix mypy errors - Miscellaneous fixes and removals of `execution_date` - Drop execution_date unique constraint on DagRun - The column has also been renamed to logical_date, although the Python model is not changed. This allows us to not need to fix all the Python code at once (we'll do that later), but still do the two changes in one migration instead of two. - Use test helpers in GCP MLEngine tests for compat - Using Airflow internals directly presents a problem when dealing with compatibility in tests (since the same tests must run against Airflow 2 and 3). The helpers already handle this well, so we should use them. - Use test helpers in GCP CloudBuild tests for compat - Using Airflow internals directly presents a problem when dealing with compatibility in tests (since the same tests must run against Airflow 2 and 3). The helpers already handle this well, so we should use them. - Mark db tests - Some compat code to make DAG.clear() still work - Remove unneeded test cases for compat code - Use test helpers in GCS-BQ tests for compat - Using Airflow internals directly presents a problem when dealing with compatibility in tests (since the same tests must run against Airflow 2 and 3). The helpers already handle this well, so we should use them.
Fix tests and schema
rawwar
commented
Nov 20, 2024
@sunank200 , will there be another PR to remove logical_date from Fastapi endpoints as well? |
sunank200
commented
Nov 20, 2024
@rawwar I think |
uranusjr
commented
Nov 20, 2024
We should remove it if the frontend can work without them. |
After renaming
execuiton_datetological_datein 43902 this PR removes thelogical_datearguments from functions and APIs that are used to retrieve DAG runs, aligning with the broader changes introduced in Airflow 2.2 and preparing for Airflow 3.0. The functions now userun_idas the sole identifier for DAG runs, simplifying the process and eliminating deprecated behaviour.Motivation:
In Airflow,
execution_datehas historically been used to distinguish different DAG run instances. However, the introduction ofrun_idand the DAG run concept in Airflow 2.2 shifts away from usingexecution_dateas an identifier. Continuing to rely onexecution_dateintroduces limitations, such as the inability to handle multiple DAG runs at the same logical time, especially in cases likeTriggerDagRunOperatorwhen dynamic runs are generated.This PR eliminates these limitations by removing
execution_dateandlogical_datein favor ofrun_id.Key Changes:
API and Function Changes:
logical_datearguments have been removed from all public APIs and Python functions related to DAG run lookups.run_idis now the exclusive identifier for DAG runs in these contexts.Database Migration:
execution_datein the database has been dropped, asrun_idnow ensures the uniqueness of DAG runs as part of #41818Rationale:
Removing
execution_dateis necessary to enable more flexible DAG run management. For example, dynamic runs created byTriggerDagRunOperatorcan now be correctly identified and managed without awkward workarounds as discussed in this doc. This change makes subsequent DAG run lookups easier and more robust, while also simplifying the database schema by removing the unique constraint onexecution_date.How
execution_dateandlogical_dateWorkAdditionally, users will still be able to view
execution_datefor reference, renamed aslogical_date, and paired withrun_idfor clarity in the web UI, making it easier to distinguish between DAG runs.Testing
closes: #42339, #42340 and #42338
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.