Bad error message when incorrect kwarg provided
Opened this issue · 0 comments
trangevi commented
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