are there any examples of using `materialize_to_me...
# ask-community
r
are there any examples of using `materialize_to_memory`to test DAGs that depend on
SourceAsset
or assets that I otherwise want to mock? The docs describe the assets argument to the function as: "The assets to materialize. Can also provide
SourceAsset
objects to fill dependencies for asset defs." but how does that dependency filling actually work seeing as the
SourceAsset
has no value and the io manager is forced to the in-memory kind?
g
do you need an explicit memory IO manager for this?
r
I think it defaults to the standard in-memory manager for all assets? But unsure if I need to overwrite it to load the mock source assets.
g
defaults indeed - my question rather was if you specify a real IO manager and want to mock/stub it out during tests especially if IO is based on side effects i.e. DBT materializing stuff how this works E2E
r
yes, I do use a custom IO manager for my source assets. In this case it's just some dataframes, but I did encounter the same issue with DBT also - as you hint at, a DBT asset raises an error if you try loading it with the default in-memory IO manager, so it doesn't play well with
materialize_to_memory
.