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

He Tomm

10/23/2020, 2:33 PM
@daniel Here is my code, and i got some error: https://dpaste.com/8ERKLY57U
d

daniel

10/23/2020, 2:40 PM
Got it - I think I see the problem. The @schedule decorator is uses to wrap a function that returns run config and turn it into a ScheduleDefinition that can then be included in a repository - you don't want to call the get_schedules function, but rather you want to include get_schedules itself in the repository. So I think you want something like this:
Copy code
@schedule(name='heatbeat', pipeline_name='heat_beat_pipeline', cron_schedule='* * * * *')
def my_schedule():
    return {} # with any run config you want for the pipeline


def heatbeat_repository():
    return [heat_beat_pipeline,] + my_schedule
(Note that it's my_schedule and not my_schedule() in the repository - the @schedule decorator turns the function into a scheduledefinition, and a repository can contain a list of scheduledefinitions - so there's no need to call the function)
(similar to why its heat_beat_pipeline in the repository and not heat_beat_pipeline())