https://dagster.io/ logo
Title
z

Zach P

10/13/2022, 10:29 PM
Is there a way to rename a given required resource required by some io_manager / op? For example, I have a few ops and io_managers that require a certain resource and use the
required_resource_keys={…}
syntax, here I’ve used generic names. I’d like to be able to override these in certain cases: eg if I have a single job that may need multiple of that type. Is there some way to provide a mapping in these cases? EG:
@io_manager(required_resource={"db_creds"})
def my_io_manager(context): ...

resource_defs_for_job = {"my_first_db_creds":db_creds(...), "my_2nd_db_creds":db_creds(...), "my_first_io_manager":my_io_manager, "my_2nd_io_manager":my_io_manager}
How can I force
my_2nd_io_manager
to use the required resource key
my_2nd_db_creds
instead of
db_creds
?
c

chris

10/17/2022, 8:53 PM
Hey! Resource remapping is a known feature incompatibility unfortunately: https://github.com/dagster-io/dagster/issues/2112 in the short term you're likely going to be forced to use different resource keys for the different types of that resource you might want to use
z

Zach P

10/17/2022, 8:56 PM
Thanks for the confirmation! Wasn’t sure exactly what words to use to search for it 🙂. Doing the renaming thing in the mean time 👍