my prefect server setup prefect-metrics.waow.tech
python orchestration
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix cleanup naming: use getattr for pydantic model parameters

prefect.runtime.flow_run.parameters returns validated pydantic objects
(not raw dicts) when FlowRunContext is active. RetentionConfig has no
.get() method — use getattr instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

zzstoatzz 3756d801 cf771946

+10 -1
+10 -1
flows/cleanup.py
··· 118 118 return {"deleted": deleted_total, "failed": failed_total} 119 119 120 120 121 - @flow(name="cleanup", log_prints=True) 121 + def _cleanup_run_name(): 122 + import prefect.runtime 123 + 124 + config = prefect.runtime.flow_run.parameters.get("config", RetentionConfig()) 125 + mode = "dry-run" if getattr(config, "dry_run", True) else "live" 126 + days = getattr(config, "days_to_keep", 30) 127 + return f"{mode}-{days}d" 128 + 129 + 130 + @flow(name="cleanup", flow_run_name=_cleanup_run_name, log_prints=True) 122 131 async def cleanup(config: RetentionConfig = RetentionConfig()) -> dict: 123 132 """Delete old terminal flow runs. 124 133