Skip to content
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

Bad error message when incorrect kwarg provided #15

Open
trangevi opened this issue Nov 8, 2019 · 0 comments
Open

Bad error message when incorrect kwarg provided #15

trangevi opened this issue Nov 8, 2019 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@trangevi
Copy link
Member

trangevi commented Nov 8, 2019

I have a function with parameter foo defined. I decorate that function properly, specifying parameter foo. However, if I call that function via a kwarg and pass it bar instead of foo, I get an index out of range error.

@input_schema('foo', StandardPythonParameterType("Hello World"))
def fun(foo):
    print(foo)

>>>fun(**{'bar': 'hello world'})
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "F:\temp\virtualEnvironments\inference_schema_dev\lib\site-packages\wrapt\wrappers.py", line 564, in __call__
    args, kwargs)
  File "f:\gitcode\inferenceschema\inference_schema\schema_decorators.py", line 56, in decorator_input
    if not isinstance(args[param_position], param_type.sample_data_type):
IndexError: list index out of range
@trangevi trangevi added the bug Something isn't working label Nov 8, 2019
@trangevi trangevi self-assigned this Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant