Skip to content

fix: validate_function_params error message #1700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Kisbogyi
Copy link

Description

Fixes #
function argument error message

When somebody created a trigger with wrong parameters the error said: "FunctionLoadError: cannot load the healthcheck function: the following parameters are declared in function.json but not in Python: {'myTimer'}" but with python function v2 functin.json is not utilized.

Examle code snippet to reproduce issue:

@bp_healthcheck.timer_trigger(
    schedule="0 */30 * * * *", arg_name="myTimer"
)
async def healthcheck() -> None:

Solution is that I rewrote the wording of the exception.

There is this comment in the call stack so I think validate_function_params should not be called when v1 function is loaded. (azure_functions_worker/dispatcher.py line 457)

# For V1, the function path will not exist and
# return None.

Moreover it has an annotations parameter, which is v2 only. So this should not be a problem.

Tests were updated!

PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made and CI is passing.

Quality of Code and Contribution Guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant