Stephen Bailey
05/11/2023, 7:12 PMAutomaterializePolicy.cron_schedule("0 0 * * *")
and AutomaterializePolicy.eager()
could solve a ton of use cases without ever having to learn about sensors and schedules classes.johann
05/12/2023, 7:22 PMsandy
05/12/2023, 8:25 PMAutoMaterializePolicy.cron_schedule("0 0 * * *")
on are at the root of the asset graph? What determines cadence you end up wanting to refresh an asset like that on? E.g. is source data that the asset is derived from that gets refreshed daily? Is there source data that gets updated continuously, but the asset doesn't need to incorporate it immediately?Stephen Bailey
05/15/2023, 4:27 PMdefine_asset_job
, AssetSelection
(or other relative python imports), schedules
, etc. So deploying a new, simple asset brings a lot Dagster framework overhead. AutomaterializePolicy
could make it so that any new asset can be deployed by only configuring it at the asset level in sufficiently simple circumstancessandy
05/16/2023, 12:21 AMI'd say I'm basically trying to remove the overhead of creating jobs, schedules, or sensors in order for a developer to deploy a new asset.That makes total sense. I share this goal. What I'm curious about here is how annoying it would be for the developer to express the schedule for the root asset in a "declarative" way, i.e. in terms of either: 1. When source data is available 2. When derived data is required to be up-to-date Example of (1): "refresh the events table whenever the raw_events table is modified"
@observable_source_asset(auto_observe_interval_minutes=30)
def raw_events():
return get_last_modified_timestamp("raw_events_table")
@asset(non_argument_deps={"raw_events"}, auto_materialize_policy=AutoMaterializePolicy.eager())
def events():
...
Example of (2): "the events table should never be more than 24 hours out of date"
@asset(
freshness_policy=FreshnessPolicy(maximum_lag_minutes=24 * 60),
auto_materialize_policy=AutoMaterializePolicy.lazy(),
)
def events():
...
Both of these are more code than what you're suggesting and don't map to it 100%, so I'm not convinced they're better. Just trying to understand how far apart your mental model is from the mental model of the current declarative scheduling system.Stephen Bailey
05/16/2023, 12:57 AMsandy
05/16/2023, 3:31 AMsandy
05/16/2023, 10:38 PMVinnie
05/17/2023, 9:47 AM