:wave: just upgraded to prefect 2.2.0, and seeing ...
# prefect-community
a
👋 just upgraded to prefect 2.2.0, and seeing some odd behavior with parameterized flows. I have a flow with a parameter
name
, and it looks like prefect is passing the parameters spec as the parameter, so
Copy code
{
  "type": "object",
  "title": "Parameters",
  "properties": {
    "name": {
      "title": "name",
      "default": "world"
    }
  }
}
is getting passed to my flow, then my flow fails with
Copy code
prefect.exceptions.SignatureMismatchError: Function expects parameters ['name'] but was provided with parameters ['type', 'title', 'properties']
not really sure what im doing wrong here...
1
b
Hi Alix, we have an example in our docs that accomplishes something similar to what you're doing here:
Copy code
from prefect import flow, task
from subflow import my_subflow

@task(name="Print Hello")
def print_hello(name):
    msg = f"Hello {name}!"
    print(msg)
    return msg

@flow(name="Hello Flow")
def hello_world(name="world"):
    message = print_hello(name)
    my_subflow(message)

hello_world("Marvin")
Here's a bit more documentation on parameters as well to get you started: https://orion-docs.prefect.io/tutorials/first-steps/?h=parameters#run-flows-with-parameters
z
Do you have a short example of the code where the parameter specification is getting passed to the flow?
a
oh, this might be a problem with the way my manifest json is currently formatted?
here's my manifest:
Copy code
{
  "flow_name": "hello-world",
  "import_path": "/path/to/flows/default.py:hello_world",
  "parameter_openapi_schema": {
    "title": "Parameters",
    "type": "object",
    "properties": {
      "name": {
        "title": "name",
        "default": "world"
      }
    },
    "required": null,
    "definitions": null
  }
}
and now if im reading these docs correctly i don' tneed a manifest anymore?
yeah, that was it. I had to change the way I was applying the deployments
🙌 1
z
👍 great thanks!