Skip to content

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
merged 4 commits into from
Apr 24, 2025

Conversation

ashb
Copy link
Member

@ashb ashb commented Apr 22, 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)

Screenshot 2025-04-22 at 14 20 05

Reported by @jscheffl #48945 (comment)

@jscheffl jscheffl added the type:bug-fix Changelog: Bug Fixes label Apr 22, 2025
Copy link
Contributor

@jscheffl jscheffl left a 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!

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`)
@ashb ashb force-pushed the latest-only-op-ignore-datainterval-width branch from 75122fb to 142ce88 Compare April 23, 2025 09:38
Co-authored-by: Kaxil Naik <[email protected]>
Co-authored-by: Jens Scheffler <[email protected]>
@ashb ashb merged commit 78615a3 into apache:main Apr 24, 2025
64 checks passed
@ashb ashb deleted the latest-only-op-ignore-datainterval-width branch April 24, 2025 09:28
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants