https://prefect.io logo
Title
j

JV

09/26/2022, 5:00 AM
Hello. I am getting below error while executing Databricks pipeline using Prefect flow on windows machine. Environment details - Python - 3.10 Prefect - 2.4.0, also tested with 2.4.1, same issue persists. Error -
prefect.exceptions.ParameterTypeError: Flow run received invalid parameters:
 - run_name: none is not an allowed value

in jobs_runs_submit_and_wait_for_completion
    jobs_runs_state, jobs_runs_metadata = await jobs_runs_wait_for_completion(
ValueError: too many values to unpack (expected 2)
โœ… 1
j

Jeff Hale

09/26/2022, 11:39 AM
Looks like you need to pass a parameter value for
run_name
when you run the flow (or set a value for the keyword argument in your flow function). If you go to the GUI and run the deployment manually with custom parameters, does it work?
j

JV

09/26/2022, 11:53 AM
Hi @Jeff Hale I am not using any parameter
run_name
in my flow. Where do I need to specify it? I have not deployed it yet to run it on GUI, currently executing it locally on my windows machine and my colleague who is executing the same code on Mac is working without any errors.
j

Jeff Hale

09/26/2022, 12:15 PM
Thank you, JV. Hmm. Okay. May be a bug. Can you share an MRE that includes the commands? Separately, I suggest upgrading to 2.4.2 for a bug fix. ๐Ÿ™‚
j

JV

09/26/2022, 12:44 PM
Hi @Jeff Hale I upgraded to 2.4.2 and executed the flow, issue persists. I am executing a flow to trigger Databricks pipeline PFB details,
Version:             2.4.2
API version:         0.8.0
Python version:      3.10.7
Git commit:          65807e84
Built:               Fri, Sep 23, 2022 10:43 AM
OS/Arch:             win32/AMD64
Profile:             default
Server type:         ephemeral
Server:
  Database:          sqlite
SQLite version:    3.37.2
ERROR   | Flow run 'encouraging-lionfish' - Validation of flow parameters failed with error: ParameterTypeError('Flow run received invalid parameters:\n - run_name: none is not an allowed value')
Traceback (most recent call last):
  File "C:\Users\.p\PycharmProjects\prefect\venv\lib\site-packages\prefect\engine.py", line 466, in create_and_begin_subflow_run
    parameters = flow.validate_parameters(parameters)
  File "C:\Users\.p\PycharmProjects\prefect\venv\lib\site-packages\prefect\flows.py", line 273, in validate_parameters
    raise ParameterTypeError.from_validation_error(exc) from None
prefect.exceptions.ParameterTypeError: Flow run received invalid parameters:
 - run_name: none is not an allowed value
18:04:46.700 | ERROR   | Flow run 'impartial-okapi' - Encountered exception during execution:
Traceback (most recent call last):
  File "C:\Users\.p\PycharmProjects\prefect\venv\lib\site-packages\prefect\engine.py", line 589, in orchestrate_flow_run
    result = await flow_call()
  File "C:\Users\.p\PycharmProjects\prefect\venv\lib\site-packages\prefect_databricks\flows.py", line 270, in jobs_runs_submit_and_wait_for_completion
    jobs_runs_state, jobs_runs_metadata = await jobs_runs_wait_for_completion(
ValueError: too many values to unpack (expected 2)
18:04:46.752 | ERROR   | Flow run 'impartial-okapi' - Finished in state Failed('Flow run encountered an exception.')
18:04:46.753 | ERROR   | Flow run 'teal-kestrel' - Encountered exception during execution:
j

Jeff Hale

09/26/2022, 1:24 PM
Iโ€™m not surprised it still exists, but still good to upgrade to 2.4.2. ๐Ÿ™‚ If the exact same code runs fine on Mac but not Windows, it does seem like itโ€™s likely to be a bug. This might be a bug with parsing file paths in Windows. Are you able to create an issue with an MRE?
a

Andrew Huang

09/26/2022, 3:38 PM
Thanks for reporting this. I think you might need to specify
run_name
in
jobs_runs_submit_and_wait_for_completion
I created an issue here.
j

JV

09/26/2022, 3:56 PM
@Andrew Huang Thanks! By specifying
run_name
parameter flow executed successfully.
j

Jeff Hale

09/26/2022, 3:59 PM
๐Ÿ‘
a

Andrew Huang

09/26/2022, 4:09 PM
good to hear. Iโ€™ll try to get that bug fixed asap
๐Ÿ‘ 1