dagster-io / dagster

An orchestration platform for the development, production, and observation of data assets.
https://dagster.io
Apache License 2.0
11.68k stars 1.47k forks source link

Easy to get into confusing situations when multiple schedules in the same repo have the same name #5864

Open sryza opened 2 years ago

sryza commented 2 years ago

Received the following feedback from a user:

Hello! I've noticed that having multiple schedules (with the same name and different cron_schedules) attached to the same job doesn't raise an error and results to multiple schedules (with the same name and same cron_schedule).

first_schedule = ScheduleDefinition(
    job=my_job,
    cron_schedule="0 0 * * 0",
)

second_schedule = ScheduleDefinition(
    job=my_job,
    cron_schedule="1 1 * * 1",
)

kinda easy to miss this one cos the schedule name defaults to job + _schedule :smile: maybe it'll be better if an error or warning is raised to avoid unintended runs?

yuhan commented 2 years ago

A warning might make more sense cos I could see one actually wants to set up multiple schedules for the same job (e.g. two teams in the same org reuse the same job but will be monitoring different schedules on their own)