John Mav
03/18/2020, 5:25 AMScheduleDefinition
's should_execute
filter to another pipeline having completed. I'm wondering if there is a way to set dependencies like Pipeline B executes at scheduled time if and only if the last run of Pipeline A successfully ran.sashank
03/18/2020, 6:13 AMshould_execute
function is passed a context
which an instance of ScheduleExecutionContext
. On this we can access context.instance
which lets us query the run storage using the get_runs
methoddef should_execute(context):
run_filter = PipelineRunsFilter(pipeline_name="Pipeline A")
runs = context.instance.get_runs(run_filter, limit=1)
if not len(runs):
return False
latest_run = runs[0]
if latest_run.status == PipelineRunStatus.SUCCESS:
return True
return False
John Mav
03/19/2020, 3:05 AM