Linton Ye
02/25/2024, 5:00 PMcontext.resources
but got an error that the resource is unknown.
Here’s the sensor:
@run_status_sensor(
run_status=DagsterRunStatus.CANCELED,
)
def cancelled_run_status_sensor(context: RunStatusSensorContext):
run_id = context.dagster_run.run_id
update_run_stats(
run_id, {"runStatus": "cancelled"}, context.resources.db.get_engine()
)
return SkipReason("Skipping sensor")
Here’s the error:
dagster._core.errors.DagsterUserCodeProcessError: dagster._core.errors.DagsterUnknownResourceError: Unknown resource `db`. Specify `db` as a required resource on the compute / config function that accessed it.
Chris Roth
02/26/2024, 3:02 AMLinton Ye
02/26/2024, 6:10 PM