What’s a good way to dependency-inject resources f...
# ask-community
m
What’s a good way to dependency-inject resources from a Job run? I have a sensor and depending on which condition triggered the RunRequest, I want to use different resources.
I’d also be okay with configuring a resource too. But I can’t figure out how to do that via Run Configs.
Ohhh, I think
build_resources
is what I want.
s
Hi @Mitchell Hynes - you can configure resources from your sensor with something like this:
Copy code
return RunRequest(run_config={"resources": {"my_resource_x": {"config": {"my_key": "my_value"}}}})
m
Ohh, sweet. Are there docs for what
run_config
takes? My intuition pointed me to the job parameters you use in the launchpad match up with it because they looked similar, but I couldn’t get it to do what I wanted to without parameterizing resources for each op which would have been a lot of code.
I ended up going with separate code locations because it was more idiomatic to the framework for what I was doing but I want to explore this more
s
Are there docs for what
run_config
takes?
Hmm, it looks like perhaps not. I will surface that to our docs folks