Hi everyone! I am trying to use software-defined ...
# ask-community
r
Hi everyone! I am trying to use software-defined assets for the following use case, but I am not sure I am doing it right. I want to create a set of assets, which each of them correspond an object which is unknown before execution. I noticed that assets can't be parameterized (except for partitions). For the sake of giving an example, let's say I have a folder with subfolders, and I want to create an asset of a dirlist for each of the subfolder, but I don't know which folders I need to create assets for before executing the first dirlist. Today, I do this by mapping over dynamic outputs, but I would like to cache these results using a key I control, and I think assets are the right tool for this job, but it seems that I am missing something.
p
Software defined assets are useful when the set of assets are known before execution. You may want to use plain execution-based ops instead, and use AssetMaterializations at runtime to record results. For caching, you might want to use our versioning/memoization API: https://docs.dagster.io/guides/dagster/memoization#versioning-and-memoization-
r
Thanks! cc @Roei Jacobovich