Moe
01/09/2025, 2:16 PMFailed 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?Marvin
01/09/2025, 2:16 PMSignatureMismatchError
, 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.Moe
01/09/2025, 2:22 PMJake Kaplan
01/09/2025, 2:50 PM@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:
@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.Moe
01/09/2025, 4:21 PM