https://dagster.io/ logo
#announcements
Title
# announcements
d

dwall

02/11/2020, 7:25 PM
can a
ScheduleDefinition
use a pipeline preset?
s

sashank

02/11/2020, 7:28 PM
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

dwall

02/11/2020, 7:30 PM
nice 👍
s

sashank

02/11/2020, 7:33 PM
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

dwall

02/11/2020, 9:20 PM
@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

sashank

02/11/2020, 9:45 PM
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