Hi I understand that I can pass asset config to th...
# ask-community
j
Hi I understand that I can pass asset config to the job that materializes the asset. (eg.
local_job = define_asset_job(name="local_job", config=config)
) What I do not understand how I pass the config to my asset if I want to use the auto-materialize assets feature instead of creating a job. Can you point me to some sample or documentation how this can be done? thanks Jorn
j
Currently it’s not possible to pass in config for auto materializing. Some possible patterns are • create a ‘preconfigured’ version of the asset for automaterializing • model the config as an input instead
j
Hi thanks for the reply I get that. Are there plans to add this later? Is it in any case a good pattern to configure assets externally rather than have them 'preconfigured'? (I did this basically in the jobs to have the possibility to tweak some settings in dagit for testing or some special backfilling settings)
j
It’s not on the immediate roadmap. Other folks on the team would be able to go deeper in the philosophy of assets and config, but in general I think config makes more sense on jobs than on assets. We want a materialization of an asset to stand as a type of guarantee that we persisted an artifact, and that gets messy if I can materialize it with different config and get different outcomes
👍 1
There’s always times where it’s convenient though, so 🤷
Depending on what you’re achieving with config, it may be possible using asset partitions. Which we definitely stand behind
j
We want a materialization of an asset to stand as a type of guarantee that we persisted an artifact
this ^ makes sense to me and I will follow this road. Highly appreciate your help 👍 cheers Jorn
g
for anyone reading this in the future: consider using a configurable resource that your asset depends on, rather than making a configurable asset especially if it's something that does not really change how the asset is computed and is environment-specific
👍 1