A new approach to AutomationCondition.on_cron() using Freshness Policies
#32725
stevenayers
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
|
Hi @stevenayers ! Thanks for putting up this discussion / the associated PR. Overall, I'm certainly a fan of using freshness policies to determine scheduling behavior, but there are some vague questions in my mind that I want to think / talk through before landing on the exact form that should take:
again, overall definitely makes sense to me that there should be some way of incorporating this information, just trying to figure out what the best way of doing that is |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all 👋 I'd like to get some feedback on an idea I've been cooking up, leveraging Freshness Policies for Declarative Automation. We use
AutomationCondition.on_cron()as our de facto condition, but it can be quite inflexible without making significant customisations.Problem Statement
on_cronseems like the go-to automation condition for most people. At first, it seems fairly straightforward:But the complexity comes in when:
Proposal
With the new Freshness Policies, and
dg.AutomationCondition.freshness_passed(),dg.AutomationCondition.freshness_warned()anddg.AutomationCondition.freshness_failed()conditions, I think there's potential for a new condition, similar toon_cronbut leveraging Freshness Policies instead of the cron time window for upstream assets.Let's say we have a new freshness condition available in the public API:
With
on_cron:That's a simple example, but the on_cron customizations can get pretty confusing. We use an automation condition builder in our code, which builds something like:
But with
on_cron_deps_fresh, you could do:Discussion
This would allow you to just define the expected cron schedule based on when you want that asset to run, define your freshness policies on your assets, and Dagster takes care of the rest! No more having to think about overlapping time windows, and instead an asset materializes on a cron schedule, as long as the dependencies are up to date 😄
I was going to raise a PR, but keen to see if anyone can help improve the design of the automation condition, or think of any pitfalls I've overlooked :)
Beta Was this translation helpful? Give feedback.
All reactions