Mykola Palamarchuk
11/21/2022, 2:45 AMFelix Ruess
11/21/2022, 8:31 AMAdam Bloom
11/21/2022, 3:40 PMMykola Palamarchuk
11/23/2022, 12:39 PMprha
11/23/2022, 10:12 PMdagster_event_type == null
correspond to calls to context.log.[debug|info|error]
in your `@asset`/`@op` functions. If you don’t need those after some amount of time, you can probably just delete them without affecting any of the historical views in dagit (or affecting retries of old runs).Mykola Palamarchuk
11/24/2022, 11:15 AMalex
11/28/2022, 4:25 PMimport datetime
from dagster import DagsterInstance, RunsFilter
instance = DagsterInstance.get()
month_ago = datetime.datetime.now() - datetime.timedelta(days=30)
batch_size = 10
old_run_records = instance.get_run_records(
filters=RunsFilter(created_before=month_ago),
ascending=True, # start from the oldest
limit=batch_size
)
for record in old_run_records:
# delete all the database contents for this run
instance.delete_run(record.pipeline_run.run_id)