Hi all! What would be the best way to get an asset...
# ask-community
y
Hi all! What would be the best way to get an asset's latest materialization within that same asset? The idea here is to compare the previous materialization with the current one to log any changes
s
This might be what you're looking for: https://github.com/dagster-io/dagster/discussions/14338
y
@sandy thanks for the reply. Indeed this seems like what i want but the example only shows how to get the metadata, any idea how I could get the actual value?
y
thanks but this caused a circler reference; i ended up just using the metadata
s
ah yes - if your Definitions object is in a different module than your asset, you'd need to import your Definitions object within the body of the function, rather than at module-level
❤️ 1
a
Hi @sandy could you please elaborate on that? There is an asset that materializes on a schedule. In the run of that asset, is it possible to get the previous materialization of the asset, not just the metadata?
s
Here's a Github discussion with more detail: https://github.com/dagster-io/dagster/discussions/14805