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

Clovis Warlop

05/16/2023, 8:32 AM
Hi all, What is the best way to set a variable that gets updated each run (example: last run date offset)
t

Tim Castillo

05/16/2023, 2:55 PM
Based on how it's used, you can set it in the metadata on each materialization and grab the most recent materialization's value. Below is a snippet on how to do it:
Copy code
context.instance.get_latest_materialization_event(AssetKey(["asset_a"])).dagster_event.event_specific_data.materialization.metadata
c

Clovis Warlop

05/23/2023, 2:57 AM
Wont this get overwritten in a backfill and screw up future runs?
2 Views