https://dagster.io/ logo
#ask-community
Title
# ask-community
y

Yehuda Ornstein

06/06/2023, 8:11 PM
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

sandy

06/06/2023, 8:37 PM
This might be what you're looking for: https://github.com/dagster-io/dagster/discussions/14338
y

Yehuda Ornstein

06/07/2023, 2:37 PM
@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

Yehuda Ornstein

06/07/2023, 8:53 PM
thanks but this caused a circler reference; i ended up just using the metadata
s

sandy

06/07/2023, 8:54 PM
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

Aaron T

06/20/2023, 4:18 PM
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

sandy

06/21/2023, 5:32 PM
Here's a Github discussion with more detail: https://github.com/dagster-io/dagster/discussions/14805