If I have a multi-asset, but am only materializing...
# ask-community
b
If I have a multi-asset, but am only materializing one of the outputs, can I stop the asset from reading in non-dependency inputs?
j
if you set
internal_asset_deps
like this example, along with the
is_required=False
necessary to only materialize one asset, i think that should work for you https://docs.dagster.io/concepts/assets/multi-assets#dependencies-inside-multi-assets
o
Specifically re: the issue of being able to dynamically decide not to read in certain inputs that are not required for computation, there's no built-in way to do this. To get something resembling this behavior, it'd get pretty hacky pretty quickly -- you'd need a custom IO manager that could examine the step context (which is a private property of the InputContext) to determine if an input is a required and if not, just short circuit and return None or something. But it'd be a fairly brittle construction
🌈 1