Simon Rascovsky
02/08/2023, 11:00 PMflow_run_name
parameter in 2.7.12 but I’m having some difficulty and I’m unable to create the deployment. It’s a flow-subflow scenario with iteration:
@flow(name="my_subflow", flow_run_name=f"my_subflow run: {iteration}", log_prints=True)
def my_subflow(iteration: str):
print(f"my_subflow run: {iteration}")
@flow(name="main_flow", log_prints=True)
def main_flow():
iteration_list = ["iteration_1", "iteration_2", "iteration_3"]
for iteration in iteration_list:
my_subflow(iteration)
When I try to deploy either of the flows with something like
prefect deployment build -n main_flow_run_name_test_deployment -q my_queue ./flows/flow_run_name_test.py:main_flow --apply
I get the error: Script at './flows/flow_run_name_test.py' encountered an exception: NameError("name 'iteration' is not defined")
VScode is also flagging the iteration
variable as not defined. How would I pass the iteration dynamically if the flow decorator is outside the function?Chris White
02/08/2023, 11:02 PMiteration
I expect this will error out or at a minimum give you a run name that is actually static and not dynamic based on the inputSimon Rascovsky
02/08/2023, 11:07 PM