Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

AIP-86 - Add Deadline References#50677

Merged
ferruzzi merged 13 commits intoapache:mainfrom
aws-mwaa:ferruzzi/deadlines/add-deadline-references
Jun 2, 2025
Merged

AIP-86 - Add Deadline References#50677
ferruzzi merged 13 commits intoapache:mainfrom
aws-mwaa:ferruzzi/deadlines/add-deadline-references

Conversation

Copy link
Contributor

ferruzzi commented May 16, 2025

Adds the framework for DeadlineReferences, along with a few examples and unit tests.


^ 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 requested review from o-nikolas and vincbeck May 16, 2025 01:03
ferruzzi requested review from XD-DENG and ashb as code owners May 16, 2025 01:03
vincbeck reviewed May 16, 2025
1fanwang approved these changes May 16, 2025
Copy link
Contributor

1fanwang left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, LGTM, minor comments

1fanwang reviewed May 16, 2025
1fanwang reviewed May 16, 2025
ferruzzi commented May 20, 2025
uranusjr reviewed May 20, 2025
Copy link
Contributor Author

ferruzzi commented May 21, 2025

Yeah, I don't like some of those changes in the last commit. I have another commit coming which rolls some of those changes back and also implement TP's suggestion. It made the models/deadline.py somewhat complicated so I moved these changes (and the relevant tests) into their own file(s), which is going to break your comment links. Sorry in advance. I'll push the new commit once mypy and static checks pass locally

uranusjr reviewed May 21, 2025
uranusjr reviewed May 21, 2025
ferruzzi requested review from amoghrajesh and kaxil as code owners May 22, 2025 03:19
uranusjr reviewed May 22, 2025
uranusjr reviewed May 22, 2025
uranusjr reviewed May 22, 2025
uranusjr reviewed May 22, 2025
Copy link
Member

uranusjr left a comment

Choose a reason for hiding this comment

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

Another approach that may improve the evaluation interface may be to make the kwargs a required dict argument instead.

# Instead of...
reference.evaluate_with()

# This might read better?
reference.evaluate_with(context={})

# Makes supplying values a bit verbose though.
reference.evaluate_with(context={"foo": 123})

ferruzzi and ramitkataria reacted with eyes emoji
Copy link
Contributor Author

ferruzzi commented May 22, 2025 *
edited
Loading

hmm. Task SDK tests failing here but passing locally in Breeze.... I'll have to look into that tomorrow I guess.

uranusjr reviewed May 23, 2025
uranusjr reviewed May 23, 2025
ferruzzi added 8 commits May 22, 2025 23:10
- removed unused _CUSTOM_REFERENCE_BASE field
- added error messaging with unit testing
- removed magic strings from the _fetch_from_db calls.
...nterface

- Update unit tests accordingly
- Break references into a new module deadline_reference.py to avoid cluttering deadline.py
- Roll back part of the previous commit that allowed _fetch_from_db to return datetime | None. If there is no datetime, we need to fail
- also added some parameter validation and adjusted the tests accordingly
ferruzzi force-pushed the ferruzzi/deadlines/add-deadline-references branch from a687fbc to 3ba1581 Compare May 23, 2025 06:37
Copy link
Contributor Author

ferruzzi commented May 23, 2025

ah, found the email thread I was looking for; I always forget that the list's search function defaults to "newer than a month". Based on that discussion, I'm dropping the caplog part of the tests.

ramitkataria approved these changes May 26, 2025
uranusjr reviewed May 27, 2025
uranusjr reviewed May 27, 2025
uranusjr reviewed May 27, 2025
Copy link
Member

uranusjr commented May 27, 2025 *
edited
Loading

Some minor comments above; none of them are blocking, just questions.

ferruzzi reacted with hooray emoji

Copy link
Contributor Author

ferruzzi commented May 28, 2025

@ashb - When you get a second can you have a look and see if I broke this down right? The part of the code that the user directly interacts with (and might be imported into a DAG) now lives in airflow/sdk/definitions/deadline.py and everything else that I don't want them using directly is in airflow/models/deadline.py.

I think when I asked about it previously, the breakdown was "required db" vs "non-db" but this feels like a more natural break for this... is it still alright or do i need to put it back to all in the sdk path except the _fetch_from_db method?

ferruzzi added this to the Airflow 3.1.0 milestone May 28, 2025
Copy link
Contributor Author

ferruzzi commented May 29, 2025

@uranusjr if you are happy with it, can you approve when you get time?

vincbeck approved these changes May 30, 2025
ferruzzi merged commit a3295a8 into apache:main Jun 2, 2025
72 checks passed
ferruzzi deleted the ferruzzi/deadlines/add-deadline-references branch June 2, 2025 18:17
sanederchik pushed a commit to sanederchik/airflow that referenced this pull request Jun 7, 2025
* AIP-86 - Add Deadline References
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

uranusjr uranusjr left review comments

vincbeck vincbeck approved these changes

o-nikolas Awaiting requested review from o-nikolas

XD-DENG Awaiting requested review from XD-DENG XD-DENG is a code owner

ashb Awaiting requested review from ashb ashb is a code owner

kaxil Awaiting requested review from kaxil kaxil is a code owner

amoghrajesh Awaiting requested review from amoghrajesh amoghrajesh is a code owner

+2 more reviewers

1fanwang 1fanwang approved these changes

ramitkataria ramitkataria approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

Airflow 3.1.0

Development

Successfully merging this pull request may close these issues.

5 participants