Hi. How can I check whether a specific partition o...
# ask-community
s
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
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
s
Ah, I didn't find that discussion thread. Thank you for the hint 😁
s
(I just created it in response to your question)
👍 1