Hello all and <@ULVA73B9P>, I had a flow deployed ...
# ask-community
m
Hello all and @Marvin, I had a flow deployed in production with optional custom parameters start_year=2022 and end_year=2024. In the UI, I edited this deployment so end_year=2025. Nothing else changed. But now it throws error:
Copy code
Failed due to a(n) SignatureMismatchError in flow parameters validation. The function expected parameters ['start_year', 'end_year', 'incremental', 'date_modified', 'practice_ids'] but received ['date_to', 'end_year', 'date_from', 'start_year', 'with_deleted', 'by_date_range', 'practice_codes'].
This is very weird behavior, seems like prefect screwed up reading in parameters or something. Can someone please advise?
m
The error you're encountering,
SignatureMismatchError
, typically arises when the parameters provided to a flow do not match the expected signature. This could be due to discrepancies in parameter names or the number of parameters expected by the flow function. ### Potential Causes: 1. Parameter Mismatch: The error message indicates a mismatch between expected and provided parameters. This can happen if the flow's function signature doesn't align with the parameters specified in the deployment. 2. UI Changes Not Propagated: Sometimes, changes made in the UI might not propagate correctly to the deployment configuration, leading to discrepancies. 3. Prefect Version Issues: There are known issues with Prefect's parameter validation, especially when using the UI for deployment changes. You might be running into one of these bugs. ### Recommended Steps: 1. Verify Flow Signature: Double-check the flow function to ensure its signature matches the parameters you're trying to pass. 2. Check Deployment YAML: Ensure that the deployment YAML accurately reflects the parameters and their default values. 3. Re-deploy: Consider re-deploying the flow after making changes to ensure all configurations are updated. 4. Prefect Version: Make sure you are using the latest version of Prefect, as some bugs related to parameter validation might have been fixed in newer releases. ### Additional Resources: - SignatureMismatchError Documentation - GitHub Issue on Parameter Validation If the problem persists, you might want to check the Prefect community forums or GitHub issues for similar cases.
m
can someone please confirm that it's a bug on prefect side?
j
Hey, When you create a deployment, it generates a schema for your flow at that point in time. It looks like when you deployed your flow, your function probably looked something like:
Copy code
@flow
def func(start_year, end_year, with_deleted, practice_codes, by_date_range):
    ...
however your deployment is just a reference to some code that actually lives somewhere (say a github repo). That code seems like it's been updated to look something like:
Copy code
@flow
def func(start_year, end_year, incremental, date_modified, practice_ids):
    ...
without your deployment being updated. If you re-deploy, the parameters should line up.
🙌 1
m
@Jake Kaplan Thank you
🙌 1
👍 1