https://dagster.io/ logo
#ask-community
Title
# ask-community
j

Johannes Müller

06/02/2023, 7:59 AM
I can see and run the job in dagit, but why does the schedule not show up with the following
Definitions
?
Copy code
from dagster import Definitions, ScheduleDefinition
from airbyte.assets import run_middleware_db_redash_pipeline


Definitions(
    jobs=[run_middleware_db_redash_pipeline],
    schedules=[ScheduleDefinition(job=run_middleware_db_redash_pipeline, cron_schedule="0 * * * *")],
)
The
Definitions
is completely ignored. If I comment it out I get the same result.
It works fine if I use a repository instead, so I'll go with that for now until I can figure out what I am doing wrong with the Definitions:
Copy code
@repository
def my_repo():
    return [ScheduleDefinition(job=my_job, cron_schedule="0 * * * *")]
c

claire

06/02/2023, 5:01 PM
Ah, I think you need to define a top-level variable that stores the
Definitions
object. Something like:
Copy code
defs = Definitions(...)
j

Johannes Müller

06/02/2023, 5:23 PM
Thanks claire! I will give that a try right away.
OMG, this actually works
Thanks so much Claire, I would never have guessed that! :D
🌈 1