Does a Dagster asset have any access to its curren...
# ask-community
c
Does a Dagster asset have any access to its current status at runtime? By this I mean, if I were materializing an asset, does it have access to the
Latest materialization
via OpExecutionContext or other method? We would like to implement branching logic depending on if this is the first time the asset/asset partition has ever been materializing versus a re-materialization or backfill.
s
c
Yep, this was exactly what I was looking for, thanks!
Copy code
@asset
def asset_1(context):
    instance = context.instance
    materialization = instance.get_latest_materialization_event(AssetKey(["asset_1"])).asset_materialization