can a `ScheduleDefinition` use a pipeline preset?
# announcements
d
can a
ScheduleDefinition
use a pipeline preset?
s
We currently don’t have an easy way to do this. but we plan on building out this API soon: https://github.com/dagster-io/dagster/issues/2056
d
nice 👍
s
For now, you could have a small helper function like:
Copy code
def schedule_definition_from_preset(schedule_name, cron_schedule, pipeline_name, preset) {
    return ScheduleDefinition(
        schedule_name,
        cron_schedule,
        pipeline_name,
        environment_dict=preset.environment_dict,
        solid_subset=preset.solid_subset,
        mode=preset.mode,
    )
}
d
@sashank is
mode
a supported parameter for ScheduleDefinition? Not seeing it in the docs
also looks like
environment_dict
is deprecated
nvm it does seem to work. I guess docs are just stale
s
Hm good catch - it looks like it’s there in the docstring but not being rendered on the docs site. You can use both
environment_dict
and
mode
– will fix that