-
Notifications
You must be signed in to change notification settings - Fork 16.4k
[AIP-86] Add deadline to DAG model #50093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ferruzzi
merged 9 commits into
apache:main
from
aws-mwaa:ferruzzi/deadlines/add-deadline-to-dag-model
May 15, 2025
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
caecb02
Add deadline to DAG model
ferruzzi eb97e7b
Add db migration for converting the `deadline` column, which will sto…
ferruzzi 46d7e6f
rename DeadlineTrigger (and related variable names) to DeadlineReference
ferruzzi 303ca54
remove unused log import
ferruzzi b4b3670
rebase and clear merge conflicts
ferruzzi 6ccf05e
Improve callback validation and handling, improve docstrings
ferruzzi 49ed943
static checks
ferruzzi 35cddbb
solve the riddles of the shpynx
ferruzzi deac158
remove unused LoggingMixin and rephrase an error message
ferruzzi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 066cb891884eea1ee0496b5c507d4a52c20d0440387f9ec8bacb1d616a26e40e | ||
| 4cda55eb221ee0340749c8dd41af7603220d7b300e2e808d733239a86e0c2837 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
50 changes: 50 additions & 0 deletions
50
airflow-core/src/airflow/migrations/versions/0069_3_1_0_add_deadline_to_dag.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| """ | ||
| Add Deadline to Dag. | ||
|
|
||
| Revision ID: dfee8bd5d574 | ||
| Revises: 29ce7909c52b | ||
| Create Date: 2024-12-18 19:10:26.962464 | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import sqlalchemy as sa | ||
| import sqlalchemy_jsonfield | ||
| from alembic import op | ||
|
|
||
| from airflow.settings import json | ||
|
|
||
| revision = "dfee8bd5d574" | ||
| down_revision = "29ce7909c52b" | ||
| branch_labels = None | ||
| depends_on = None | ||
| airflow_version = "3.1.0" | ||
|
|
||
|
|
||
| def upgrade(): | ||
| op.add_column( | ||
| "dag", | ||
| sa.Column("deadline", sqlalchemy_jsonfield.JSONField(json=json), nullable=True), | ||
| ) | ||
|
|
||
|
|
||
| def downgrade(): | ||
| op.drop_column("dag", "deadline") |
60 changes: 60 additions & 0 deletions
60
airflow-core/src/airflow/migrations/versions/0070_3_1_0_change_deadline_to_utc.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| """ | ||
| Change the Deadline column in the Deadline table from DateTime to UTC DateTime. | ||
|
|
||
| Revision ID: 0242ac120002 | ||
| Revises: dfee8bd5d574 | ||
| Create Date: 2024-12-18 19:10:26.962464 | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import sqlalchemy as sa | ||
| from alembic import op | ||
|
|
||
| from airflow.migrations.db_types import TIMESTAMP | ||
|
|
||
| revision = "0242ac120002" | ||
| down_revision = "dfee8bd5d574" | ||
| branch_labels = None | ||
| depends_on = None | ||
| airflow_version = "3.1.0" | ||
|
|
||
|
|
||
| def upgrade(): | ||
| """Apply change deadline column in the deadline table to UTC datetime.""" | ||
| with op.batch_alter_table("deadline", schema=None) as batch_op: | ||
| batch_op.alter_column( | ||
| "deadline", | ||
| existing_type=sa.DateTime(), | ||
| type_=TIMESTAMP(timezone=True), | ||
| existing_nullable=False, | ||
| ) | ||
|
|
||
|
|
||
| def downgrade(): | ||
| """Unapply change deadline column in the deadline table to UTC datetime.""" | ||
| with op.batch_alter_table("deadline", schema=None) as batch_op: | ||
| batch_op.alter_column( | ||
| "deadline", | ||
| existing_type=TIMESTAMP(timezone=True), | ||
| type_=sa.DateTime(), | ||
| existing_nullable=False, | ||
| ) |
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
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.