Hello! In the v1.2.2 <changelog>, I see an experim...
# ask-community
l
Hello! In the v1.2.2 changelog, I see an experimental feature that allows a
required_resource_keys
to be specified for sensors. From what I understood I should use
with_resources
in my repository. As follows:
Copy code
@sensor(
    job=my_job,
    required_resource_keys={"my_resource"}
)
def my_sensor(context):
    context.my_resource...

@repository
def my_repo():
    return *with_resources(
        definitions=[my_sensor],
        resource_defs={'my_resource': my_resource}
    )
When I do so I get this error :
Copy code
'SensorDefinition' object has no attribute 'with_resources'
Is there anything I do wrong ? Thank you by advance and have a nice day, Louis
🤖 1
s
Hmm I’m guessing that new feature only works with the Definitions API: https://docs.dagster.io/concepts/code-locations#defining-code-locations
Definitions
does not require
with_resources
, the sensors will be able to bind any resources passed to the
Definitions
object.
l
Oh thanks a lot !