is there a way to use resources in a run_status_se...
# ask-community
is there a way to use resources in a run_status_sensor? we'd like to have a sensor that monitors a job and only kicks off a RunRequest if the job had succeeded AND a query that we run against one of our databases has a certain condition. I figured the ease of run_status_sensor would help here with monitoring my job, but there doesn't seem a way to specify certain resource keys in the definition.
Hi Danny. I believe in 1.2.2 we added experimental support to allow resource requirements for schedules and sensors when using a
Copy code
@sensor(job=my_job, required_resource_keys={"my_resource"})
def my_sensor(context):
    files_to_process = context.my_resource.get_files()

def my_sensor(context, my_resource: MyResource):
    files_to_process = my_resource.get_files()
Ah, apologies, I think this is currently not enabled for run status sensors yet. I'd recommend filing an issue for tracking purposes if this is a functionality you want
👍 3
Hello. I'm using resources, built with build_resources func inside run status sensors.
Hi, just found this post as I want to do a similar thing - ie. query a database table and check for new data and if there is, trigger a sensor to run a job. Is this possible yet?
And if so, is it possible to supply
to a sensor with a resource as the config file will contain the database connection details required to connect to and query the database and then trigger the sensor run if a certain condition in the database is met?
I worked around it by just using a plain
and then adding the
to that, and in the body of the sensor I'm using
to filter for the specific job run that I'm looking for