Skip to content

Conversation

@ferruzzi
Copy link
Contributor

@ferruzzi ferruzzi commented May 1, 2025

First step in AIP-86 to add Deadline Alerts. Plenty more to come, but I wanted to break it down into reasonable bites for easier review.

This PR adds the new Deadline field to the DAG database table, a new model to handle the Deadline, and the unit tests to cover those additions. The next PR (already queued up once this is merged) will implement the DeadlineTrigger class which I sketched out in this one.

Example usage:

@task
def hello():
    log.info('hello world')

with DAG(
    dag_id='dag_with_deadline',
    deadline=DeadlineAlert(
        trigger=DeadlineTrigger.DagrunExecutionDate,
        interval=timedelta(hours=1),
        callback=hello,
    )
):
    hello()

^ 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.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@ferruzzi
Copy link
Contributor Author

ferruzzi commented May 1, 2025

Looks like I need to add a db migration for the DateTime => DateTimeUTC type change. Fix coming.

@ferruzzi ferruzzi requested review from o-nikolas and vincbeck May 1, 2025 19:33
@ferruzzi ferruzzi force-pushed the ferruzzi/deadlines/add-deadline-to-dag-model branch from 18e226d to b3e2426 Compare May 6, 2025 23:06
@eladkal eladkal self-requested a review May 8, 2025 15:23
@ferruzzi ferruzzi added this to the Airflow 3.1.0 milestone May 8, 2025
@ferruzzi ferruzzi mentioned this pull request May 12, 2025
1 task
Copy link
Contributor

@1fanwang 1fanwang left a comment

Choose a reason for hiding this comment

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

Thank you for the PR, LGTM, left minor comments mostly for my learning.

ferruzzi added 5 commits May 14, 2025 17:15
Example usage:

```
@task
def hello():
    log.info('hello world')

with DAG(
    dag_id='dag_with_deadline',
    deadline=DeadlineAlert(
        trigger=DeadlineTrigger.DAGRUN_LOGICAL_DATE,
        interval=timedelta(hours=1),
        callback=hello_callback,
    )
):
    hello()
```
…re a calculated datetime/timestamp, from DateTime to DateTimeUTC.
@ferruzzi ferruzzi merged commit 4a2cb2f into apache:main May 15, 2025
95 checks passed
@ferruzzi ferruzzi deleted the ferruzzi/deadlines/add-deadline-to-dag-model branch May 15, 2025 22:28
sanederchik pushed a commit to sanederchik/airflow that referenced this pull request Jun 7, 2025
* Add deadline to DAG model

Example usage:

```
@task
def hello():
    log.info('hello world')

with DAG(
    dag_id='dag_with_deadline',
    deadline=DeadlineAlert(
        trigger=DeadlineTrigger.DAGRUN_LOGICAL_DATE,
        interval=timedelta(hours=1),
        callback=hello_callback,
    )
):
    hello()
```
kaxil added a commit to astronomer/airflow that referenced this pull request Sep 26, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
amoghrajesh pushed a commit that referenced this pull request Sep 26, 2025
This was removed in #50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Sep 30, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 1, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 2, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 3, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 4, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 5, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 5, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 7, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 8, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 9, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 10, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 11, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 12, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
dabla pushed a commit to dabla/airflow that referenced this pull request Oct 12, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 14, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 15, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 17, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 19, 2025
This was removed in apache#50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x
kaxil added a commit that referenced this pull request Oct 21, 2025
This was removed in #50093 -- I assume by mistake! Adding this back to not break das of people migration from Airflow 2.x

(cherry picked from commit 9cd9c9f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants