Igor Bondartsov
03/23/2021, 2:45 PMJenny
03/23/2021, 2:52 PMJenny
03/23/2021, 2:53 PMIgor Bondartsov
03/23/2021, 2:59 PMSamuel Hinton
03/23/2021, 3:02 PMIgor Bondartsov
03/23/2021, 3:31 PMJenny
03/23/2021, 3:48 PMJenny
03/23/2021, 3:54 PMfrom prefect import Flow, task
import prefect
from prefect.tasks.prefect.flow_run_rename import RenameFlowRun
@task()
def getId():
return prefect.context.get('flow_run_id')
rename_flow = RenameFlowRun()
with Flow(name='simple-flow') as flow:
runId = getId
rename_flow(flow_run_id=runId, flow_run_name="A new flow run name")
flow.register(project_name='ProjectName')
Samuel Hinton
03/23/2021, 3:54 PMflow.register(project_name=self.project, name="Send email at {date}")
I believe right now using renameFlowRun
this is renaming a specific flow run, and I would need to continually run this every day when a new flow is scheduled (unless Ive misread things)
I have a manual solution right now for when backfilling (@Igor Bondartsov maybe this is useful?), but not for future scheduled tasks:
self.client.create_flow_run(
flow_id,
parameters=p,
run_name=f"{flow_name} @ {date_name}",
scheduled_start_time=start,
)
Jenny
03/23/2021, 4:01 PMSamuel Hinton
03/23/2021, 4:02 PMJenny
03/23/2021, 4:05 PMMarvin
03/23/2021, 4:05 PMChris White
Samuel Hinton
03/23/2021, 4:30 PMIgor Bondartsov
03/23/2021, 4:40 PMChris White