-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Make LatestOnlyOperator work for default data-interval-less DAGs #49554
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
ashb
merged 4 commits into
apache:main
from
astronomer:latest-only-op-ignore-datainterval-width
Apr 24, 2025
Merged
Make LatestOnlyOperator work for default data-interval-less DAGs #49554
ashb
merged 4 commits into
apache:main
from
astronomer:latest-only-op-ignore-datainterval-width
Apr 24, 2025
Conversation
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
ashb
commented
Apr 22, 2025
providers/standard/tests/unit/standard/operators/test_latest_only_operator.py
Show resolved
Hide resolved
ashb
commented
Apr 22, 2025
providers/standard/tests/unit/standard/operators/test_latest_only_operator.py
Show resolved
Hide resolved
jscheffl
approved these changes
Apr 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good in my view. Backcompat just has a small glitch. Otherwise would favor to merge this even if it is "technically breaking" but was rather broken before.
Thanks for jumping on the comment and making the fix!
providers/standard/src/airflow/providers/standard/operators/latest_only.py
Outdated
Show resolved
Hide resolved
amoghrajesh
approved these changes
Apr 23, 2025
Remove the check/don't skip logic whe the data interval is zero-wdith. Even if a DAG doesn't have the concept of a data-interval (i.e. it is zero width) it still is logically consistent for it to have to concept of latest or not, so we now only compare against the end date of the interval. (And a few drive-by refactors too, `context["task"]` is `self`, `context["dag"]` is `self.dag`)
75122fb
to
142ce88
Compare
kaxil
reviewed
Apr 23, 2025
providers/standard/src/airflow/providers/standard/operators/latest_only.py
Outdated
Show resolved
Hide resolved
kaxil
approved these changes
Apr 23, 2025
Co-authored-by: Kaxil Naik <[email protected]> Co-authored-by: Jens Scheffler <[email protected]>
ashb
commented
Apr 23, 2025
providers/standard/src/airflow/providers/standard/operators/latest_only.py
Outdated
Show resolved
Hide resolved
8 tasks
prabhusneha
pushed a commit
to astronomer/airflow
that referenced
this pull request
Apr 25, 2025
…che#49554) Remove the check/don't skip logic whe the data interval is zero-wdith. Even if a DAG doesn't have the concept of a data-interval (i.e. it is zero width) it still is logically consistent for it to have to concept of latest or not, so we now only compare against the end date of the interval. (And a few drive-by refactors too, `context["task"]` is `self`, `context["dag"]` is `self.dag`)
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.
Remove the check/don't skip logic whe the data interval is zero-wdith. Even if
a DAG doesn't have the concept of a data-interval (i.e. it is zero width) it
still is logically consistent for it to have to concept of latest or not, so
we now only compare against the end date of the interval.
(And a few drive-by refactors too,
context["task"]
isself
,context["dag"]
isself.dag
)Reported by @jscheffl #48945 (comment)