Keep Your Dashboard Clean
Learn how to keep your pipeline runs clean during development.
Run locally
zenml login --localPipeline Runs
Deleting Pipeline Runs
zenml pipeline runs delete <PIPELINE_RUN_NAME_OR_ID>#!/usr/bin/env python3
import datetime
from zenml.client import Client
def delete_recent_pipeline_runs():
# Initialize ZenML client
zc = Client()
# Calculate the timestamp for 24 hours ago
twenty_four_hours_ago = datetime.datetime.now(timezone.utc) - datetime.timedelta(hours=24)
# Format the timestamp as required by ZenML
time_filter = twenty_four_hours_ago.strftime("%Y-%m-%d %H:%M:%S")
# Get the list of pipeline runs created in the last 24 hours
recent_runs = zc.list_pipeline_runs(created=f"gt:{time_filter}")
# Delete each run
for run in recent_runs:
print(f"Deleting run: {run.id} (Created: {run.body.created})")
zc.delete_pipeline_run(run.id)
print(f"Deleted {len(recent_runs)} pipeline runs.")
if __name__ == "__main__":
delete_recent_pipeline_runs()Pipelines
Deleting Pipelines
Unique Pipeline Names
Models
Artifacts
Pruning artifacts
Cleaning your environment
Last updated
Was this helpful?