<#27 refactor(runtime): improve required inputs va...
# flyte-github
c
#27 refactor(runtime): improve required inputs validation logic Pull request opened by pingsutw If the input names mismatch the required inputs, we should raise an error as well Before:
Copy code
File "/Users/kevin/git/flyte-sdk/src/flyte/_internal/runtime/entrypoints.py", line 39, in direct_dispatch
    return await contextual_run(
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kevin/git/flyte-sdk/src/flyte/_context.py", line 152, in contextual_run
    return await _ctx.run(func, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kevin/git/flyte-sdk/src/flyte/_internal/runtime/taskrunner.py", line 142, in convert_and_run
    inputs_kwargs = await convert_inputs_to_native(inputs, task.native_interface)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kevin/git/flyte-sdk/src/flyte/_internal/runtime/convert.py", line 57, in convert_inputs_to_native
    native_vals = await TypeEngine.literal_map_to_kwargs(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kevin/git/flyte-sdk/src/flyte/types/_type_engine.py", line 1243, in literal_map_to_kwargs
    raise TypeTransformerFailedError(

TypeTransformerFailedError: Error converting input:
Literal value: 
Expected Python type: <class 'str'>
Exception: Cannot convert literal  to <class 'str'>
After:
Copy code
File "/Users/kevin/git/flyte-sdk/src/flyte/_run.py", line 414, in _run_local
    outputs = await awaitable
              ^^^^^^^^^^^^^^^
  File "/Users/kevin/git/flyte-sdk/src/flyte/_internal/controllers/_local_controller.py", line 83, in submit
    inputs = await convert.convert_from_native_to_inputs(_task.native_interface, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kevin/git/flyte-sdk/src/flyte/_internal/runtime/convert.py", line 110, in convert_from_native_to_inputs
    raise ValueError(f"Missing required inputs: {', '.join(missing)}")

ValueError: Missing required inputs: city
flyteorg/flyte-sdk