Should auto-materialize launch a run when the asse...
# ask-community
c
Should auto-materialize launch a run when the asset has a new code version? If not, is there a way to make that happen?
o
hi @Charlie Bini! this is not intended behavior at the moment, but it's definitely reasonable to imagine supporting. would you imagine this happening as soon as a code version change was detected, or would you expect it to wait until all upstream dependencies were up to date? also, are you dealing with partitions as well here, or just unpartitioned assets?
c
unpartitioned assets, and I would expect it to update as soon as the code version change
this is specifically a challenge with dbt assets
i.e. I need to update a line of SQL, and would like to see it propagated to our db as soon as Dagster updates
In that instance, the upstream data doesn't matter. I'd like the asset to update itself and downstream assets
an optional configuration on the automaterialize policy would make sense for this IMO
o
got it, that all makes sense! 100% agree that this is a reasonable addition to the logic. just fishing for ideas, but if you were to imagine creating an AMP with this property, what would feel most natural to you (purely in terms of the python API)? in terms of short-term solutions, I think the only real option would be a more manual sensor-based approach that compares the latest materialization's code version to the current code version of each asset, but this sort of logic definitely feels better in the asset daemon
c
as it exists, probably a kwarg would make the most sense:
auto_materialize_policy=AutoMaterializePolicy.eager(code_version=True, ...)
I think long-term, incorporating the pythonic Config style would help make everything more consistent:
AutoMaterializePolicy(type="eager", on_code_versions=True, ...)
or something in that vein
o
Got it, appreciate that feedback 🙏