Configuring partition-aware freshness policy in Dagster #34023
Replies: 1 comment 1 reply
|
Your reading of the new policy is correct. The current evaluator is asset-level, not partition-level: it loads So a recent backfill of an old partition can indeed turn the new There is, however, a Dagster-native check that implements exactly your required semantics: For example: import dagster as dg
daily_checks = dg.build_time_partition_freshness_checks(
assets=[daily_asset],
deadline_cron="0 9 * * *", # expected previous daily partition by 09:00
timezone="UTC",
)
weekly_checks = dg.build_time_partition_freshness_checks(
assets=[weekly_asset],
deadline_cron="0 9 * * 1", # expected previous weekly partition by Mon 09:00
timezone="UTC",
)
freshness_checks = [*daily_checks, *weekly_checks]
freshness_sensor = dg.build_sensor_for_freshness_checks(
freshness_checks=freshness_checks,
)
defs = dg.Definitions(
assets=[daily_asset, weekly_asset],
asset_checks=freshness_checks,
sensors=[freshness_sensor],
)Use one check group/deadline per cadence. It works for The caveat is API direction: Therefore my migration path would be:
I cannot find a public commitment or release date for partition-aware evaluation in the new policy, so only the maintainers can give an ETA. The current published “Future enhancements” list does not promise it yet. |
Uh oh!
There was an error while loading. Please reload this page.
Hello!
I would like to start using freshness policies for our deployments - particularly CRON ones - however one thing that bothers me is that it seems fully partition-agnostic, meaning that it simply requires any partition to materialise within the time window, not necessarily the latest one.
The issue for my use case is that we want to use it to track monthly, weekly and daily workloads, and of course the goal is to monitor and spot any latest partitions that are missing. We want to avoid situation where e.g. backfilling some old partition or re-running it would automatically set the asset to "
fresh", despite the fact that the latest partition is in fact missing.How can this be tackled? Would partition-aware freshness policies be supported in future in Dagster? If so, when? Is there a better method/tool in Dagster to monitor scheduled workloads with rigid frequency (daily, weekly, monthly, quarterly) for staleness and incomplete/missing/failed runs?
So far we had a custom sensor to handle that, but that in itself was quite buggy. We would prefer to use a Dagster-native solution; the freshness policies looks like an almost perfect tool, albeit the fact that it has no visibility which partition actually ran and whether it was the latest makes it also not ideal for the job.
Thanks for any tips and help!
All reactions