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

Simon Ammer

08/28/2023, 2:55 PM
Hi. How can I check whether a specific partition of an asset is materialized? I know that is possible for an asset:
Copy code
if context.instance.get_latest_materialization_event(AssetKey("my_asset")) is not None:
   pass
t

Timo Vink

08/28/2023, 3:05 PM
Maybe:
Copy code
asset_key = ...
partition_key = ...

materialization_counts = context.instance.get_materialization_count_by_partition([asset_key])
materialization_count = materialization_counts.get(asset_key, {}).get(partition_key, 0)
is_materialized = materialization_count > 0
s

sandy

08/28/2023, 3:22 PM
s

Simon Ammer

08/29/2023, 7:15 AM
Ah, I didn't find that discussion thread. Thank you for the hint 😁
s

sandy

08/29/2023, 8:42 PM
(I just created it in response to your question)
👍 1