Behaviour and meaning of run_key #18619
Replies: 2 comments 1 reply
-
You're right that https://docs.dagster.io/_apidocs/schedules-sensors#dagster.RunRequest.run_key |
Beta Was this translation helpful? Give feedback.
-
For those also running into this when switching a sensor to a schedule, you can put this in your schedule function to skip RunRequests for existing run_keys: @schedule
def my_func(context: ScheduleEvaluationContext):
run_key = ....
if context.instance.get_runs(RunsFilter(tags={'dagster/run_key': run_key})):
context.log.debug(f'Skipping previously processed key {run_key}')
else:
yield RunRequest(run_key=run_key, ...) |
Beta Was this translation helpful? Give feedback.
-
Hi, Im probably missing something here, but why does the
run_key
work differently for sensors than schedules. I would have thought that therun_key
uniquely defines the run, so that if you launch a run with the same key multiple times, then it will be ignored, but it seems that the run happens multiple times with the samerun_key
... :/Beta Was this translation helpful? Give feedback.
All reactions