# ask-ai

Christopher Tee

03/13/2024, 4:00 PM
@Scout within a `@run_status_sensor`’s context, how can I infer whether a particular op within a run executed or not?


03/13/2024, 4:00 PM
Within a
context, you cannot directly infer whether a particular op within a run executed or not. The
provided to a
function includes information about the run's overall status (e.g., success, failure), but it does not contain detailed execution information about individual ops within the run. The
includes attributes such as
(which represents the run that triggered the sensor) and
(which represents the event that caused the sensor to trigger). However, these do not provide op-level execution details. If you need to determine whether a specific op executed within a run, you would typically need to inspect the run's logs or events after the run has completed. This could involve querying the Dagster instance for the run's event logs and checking for events related to the execution of the specific op you are interested in. For more granular control and monitoring at the op level, you might consider using hooks or custom logic within your ops to record their execution status to an external system or to emit custom events that can be monitored separately. Remember that the primary purpose of a
is to react to changes in the status of runs, such as when a run starts, succeeds, or fails, rather than to monitor the execution of individual ops within those runs. Bind run_status_sensor for a specific jo... button run_status_sensor behind runs - consider... button Include logger as part of SensorContext button It's not clear how I should unittest a r... button Thank you for your feedback!