Barry Sun
06/03/2022, 5:47 AMjamie
06/03/2022, 2:40 PMio_manager
your run config would look like this
resources:
io_manager:
config:
base_dir: "new/path"
or the equivalent in python dictionary form if that's how you're specifying configBarry Sun
06/06/2022, 6:11 AMjamie
06/06/2022, 4:01 PMos.path.join
call is throwing the error, which would make me believe that self._base_path
isn't being properly set in your __init__
It might be useful to throw a couple print statements in your init to make sure the value from config is getting passed through and set as an instance variable as expectedBarry Sun
06/07/2022, 12:22 AMself._base_path
like so. I'll give the print statements a go too!context
and init_context
?
I've also seen config being supplied to resources via i) df_table_io_manager.configure({'base_path': 'data/raw/'})
and ii) supplying the config as you did. I wonder when is the right time to use each one?jamie
06/07/2022, 2:12 AMcontext
in all cases and be fine (i haven't confirmed this everywhere but i'm pretty sure it's true). it's likely a naming discrepancy in our documentation, or a naming choice to indicate that it's the context passed when the resource is initialized (feature or bug ¯\_(ツ)_/¯ )
as for the configured
API, it provides another way to provide config to a resource in code. so it may be that for a certain job you always want base_path
to be home/me/great_path
and the configured
API allows you to specify it in code once and never have to deal with it again. providing run config via the dagit UI allows you to modify config more "on the fly" and update values for every run of a job. you may have already found this documentation, but the opening sections do a pretty good job going over cases when you might want to use configured
(link)Barry Sun
06/07/2022, 3:46 AM