https://dagster.io/ logo
Title
l

Louis Auneau

01/25/2022, 6:16 PM
Hello everyone ! I build some status sensors (both
run_failure_sensor
and
run_status_sensor
) and I noticed few issues (v0.13.16): • If the sensor doesn’t have a return statement, the sensor is not triggered. • There is no
build_run_failure_sensor_context
or
build_status_sensor_context
which make unit-testing more complicated. • I did not manage to trigger the failure sensor from a test function. Do you have any idea why it needs a return statement ? And how to test such sensors ? Thank you by advance 🙂
p

prha

01/25/2022, 6:58 PM
cc @yuhan
y

yuhan

01/25/2022, 7:05 PM
looking re:
build_run_failure_sensor_context
 , 
build_status_sensor_context
i think it makes sense to add them as util funcs
l

Louis Auneau

01/25/2022, 8:16 PM
Do you want me to open an issue on GitHub to track progress ?
y

yuhan

01/25/2022, 8:16 PM
yes plz that would be great! thank you
However, adding those functions won’t solve the fact that triggering a failure sensor manually is fairly difficult, because you need to fake: • Cursor, • Instance events to have failure events, • Instance runs to have a failed run. Is there any way to retrieve the actual
run_status_sensor_fn
?From the source code, it seems this is not possible.