I can see and run the job in dagit, but why does t...
# ask-community
j
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
Ah, I think you need to define a top-level variable that stores the
Definitions
object. Something like:
Copy code
defs = Definitions(...)
j
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