Eduardo Santizo
04/05/2021, 5:09 PMdef CAMP_restart_sensor(context):
runs = context.instance.get_runs(
filters=PipelineRunsFilter(
# Pipeline to check using the sensor
pipeline_name="CAMP_pipeline",
statuses=[PipelineRunStatus.FAILURE],
),
)
for run in runs:
# Use the id of the failed run as run_key to avoid duplicate alerts.
yield RunRequest(...)
When I looked into it, it seems like the PipelineRunsFilter is a GraphQL related function. This also made me curious. How exactly can I integrate GraphQL queries inside python? Is there a specific way or is it like any other GraphQL implementation?prha
04/05/2021, 5:15 PMEduardo Santizo
04/05/2021, 5:19 PMprha
04/05/2021, 5:21 PMfrom dagster.core.storage.pipeline_run import PipelineRunStatus, PipelineRunsFilter
from dagster import PipelineRunStatus, PipelineRunsFilter
, but need to think about that a bit moreEduardo Santizo
04/05/2021, 5:51 PMfrom dagster import PipelineRunStatus, PipelineRunsFilter
but Python refused to recognize this, so I came to the conclusion that maybe the import statement was not needed.