Hi team, when using `Definitions` , there is a res...
# ask-community
q
Hi team, when using
Definitions
, there is a resource argument that is applied to assets by default. For e.g.
Copy code
defs = Definitions(assets=[], jobs=[], resources={'io_manager': my_custom_io_manager})
This
io_manager
key becomes the default
io_manager
for assets and asset jobs. However, I am noticing this is not the case for ops and op jobs. how can I pass this key from the
Definitions
to a job without having to create the resource again in the
resource_defs
argument for jobs?
s
This is now possible using
BindResourcesToJobs
- @ben - what's the best place to find an example for this?
b
You should be able to wrap the list of jobs passed to
Definitions
, e.g.
Copy code
defs = Definitions(
    jobs=BindResourcesToJobs([my_job, my_other_job]),
    resources={"io_manager": my_custom_io_manager}
)
(This will be the default behavior in 1.3+)
q
Thank you both, you're amazing!