https://dagster.io/ logo
Title
m

My Mai

02/27/2022, 9:07 PM
Hi guys, new here, trying to build a POC with scheduling. I'm reviewing the docs and I'm getting hung up on what's being returned in this schedule function.
@schedule(
    cron_schedule="45 6 * * *",
    job=hello_cereal_job,
    execution_timezone="US/Central",
)
def good_morning_schedule(context):
    date = context.scheduled_execution_time.strftime("%Y-%m-%d")
    return {"ops": {"hello_cereal": {"config": {"date": date}}}}
specifically the last line here -- is this returning a schedule definition for an op in the hello_cereal_job? Would this syntax change if are were more than one op in this job? Thanks!
d

daniel

02/28/2022, 5:06 AM
Hi, this is returning configuration for the run that's launched by the schedule. If you use Dagit, it's the same thing you write as YAML into the Launchpad to launch the job. It's explained in more detail here: https://docs.dagster.io/tutorial/advanced-tutorial/configuring-ops#specifying-config-for-job-execution Ops don't have to require configuration - if your run doesn't require any configuration, you can return an empty dict here and the run will still launch, no matter how many ops are in the job. But if you had a second op that also required configuration, like
hello_cereal
does in the example, you could configure the two ops separately by having multiple keys in the "ops" dictionary.
m

My Mai

02/28/2022, 6:22 PM
Thanks so much! Does dagster allow multiple jobs to be run off one schedule?
s

Solaris Wang

03/22/2022, 5:33 PM
@daniel found this thread and was wondering if schedules can accept configs in the Launchpad yaml section? Or is the Dagit Launchpad only for ad-hoc runs, such that scheduled runs must have configs defined in code? @Joe Toninato
d

daniel

03/22/2022, 6:30 PM
Hi solaris - the Launchpad yaml section is just for ad-hoc runs, yeah
:ty-thankyou: 1