eli
04/26/2021, 9:02 PMStartFlowRun
Task?
I've been trying to run a flow of flows, but get validation errors despite passing the required parameters to the flow
a mocked up example
param_a = Parameter(name="param_a")
param_b = Parameter(name="param_b", required=True)
@task(log_stdout=True)
def print_param(param):
print(param)
# start flow run task instance
start_flow_run = StartFlowRun(project_name="required_test", wait=True)
with Flow("flow1") as f1:
print_param(param_a)
with Flow("flow2") as f2:
print_param(param_a)
print_param(param_b) # the required one
with Flow("main") as f:
# this works, ignoring the extra unused param
start_flow_run(flow_name="flow1", parameters={"param_a": "a", "param_b": "b"})
# this fails raising a validation error in the logs
start_flow_run(flow_name="flow2", parameters={"param_a": "a", "param_b": "b"})
The error:
prefect.utilities.exceptions.ClientError: [{'path': ['create_flow_run'], 'message': "Required parameters were not supplied: {'param_b'}", 'extensions': {'code': 'INTERNAL_SERVER_ERROR'}}]
Kevin Kho
param_a
definition underneath flow1 and flow 2 and param_b
underneath flow2?Zanie
ipython -i your_script.py
then %debug
after the error.Zanie
Zanie
Kevin Kho
eli
04/27/2021, 8:31 PMcompute_parameters
task were being "lost" (discarded) before start_flow_run was called.Kevin Kho