Tony Yun
08/30/2021, 3:46 PMcreate_flow_run
in code. What’s the simpliest thing to change by giving the flow run a customized run-id? Assume I only need to trigger the flow run using schedules or UI.Kevin Kho
RenameFlowRun
task inside your flow code. DocsTony Yun
08/30/2021, 3:56 PMKevin Kho
Tony Yun
08/30/2021, 3:59 PMTony Yun
08/30/2021, 3:59 PMKevin Kho
create_flow_run
takes in a run_name
argument if you are using the Client
Tony Yun
08/30/2021, 4:03 PMTony Yun
08/30/2021, 4:05 PMKevin Kho
RenameFlowRun
in the flow would be the easiest approach. It can’t be set as the flow is created, unless a one time thing with create_flow_run
Tony Yun
08/30/2021, 4:09 PMRenameFlowRun("hello-flow-1", flow_run_name='test-1')
with Flow(
"hello-flow",
schedule
) as flow:
# download_report()
load_report(upstream_tasks=[download_report])
Tony Yun
08/30/2021, 4:09 PMKevin Kho
RenameFlowRun
has to be inside the Flow
You don’t need to supply the id. Just do RenameFlowRun()(flow_run_name="new_name")
inside the Flow.Tony Yun
08/30/2021, 4:20 PM/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/contextlib.py:120: UserWarning: Tasks were created but not added to the flow: {<Task: RenameFlowRun>}. This can occur when `Task` classes, including `Parameters`, are instantiated inside a `with flow:` block but not added to the flow either explicitly or as the input to another task. For more information, see <https://docs.prefect.io/core/advanced_tutorials/task-guide.html#adding-tasks-to-flows>.
Kevin Kho
with Flow(
"hello-flow",
schedule
) as flow:
RenameFlowRun()(flow_run_name='test-1')
load_report(upstream_tasks=[download_report])