Skip to content

Commit

Permalink
Update error message for TypeTransformerFailedError (#2648)
Browse files Browse the repository at this point in the history
Signed-off-by: wayner0628 <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Co-authored-by: Kevin Su <[email protected]>
  • Loading branch information
wayner0628 and pingsutw authored Aug 5, 2024
1 parent fecd41c commit 243e1be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions flytekit/core/base_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def local_execute(
except TypeTransformerFailedError as exc:
msg = f"Failed to convert inputs of task '{self.name}':\n {exc}"
logger.error(msg)
raise TypeError(msg) from exc
raise TypeError(msg) from None
input_literal_map = _literal_models.LiteralMap(literals=literals)

# if metadata.cache is set, check memoized version
Expand Down Expand Up @@ -724,7 +724,7 @@ def dispatch_execute(
except Exception as exc:
msg = f"Failed to convert inputs of task '{self.name}':\n {exc}"
logger.error(msg)
raise type(exc)(msg) from exc
raise type(exc)(msg) from None

# TODO: Logger should auto inject the current context information to indicate if the task is running within
# a workflow or a subworkflow etc
Expand Down
2 changes: 1 addition & 1 deletion flytekit/core/promise.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def my_wf(in1: int, in2: int) -> int:
v = resolve_attr_path_in_promise(v)
result[k] = TypeEngine.to_literal(ctx, v, t, var.type)
except TypeTransformerFailedError as exc:
raise TypeTransformerFailedError(f"Failed argument '{k}': {exc}") from exc
raise TypeTransformerFailedError(f"Failed argument '{k}': {exc}") from None

return result

Expand Down
2 changes: 1 addition & 1 deletion flytekit/core/type_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ def literal_map_to_kwargs(
try:
kwargs[k] = TypeEngine.to_python_value(ctx, lm.literals[k], python_interface_inputs[k])
except TypeTransformerFailedError as exc:
raise TypeTransformerFailedError(f"Error converting input '{k}' at position {i}:\n {exc}") from exc
raise TypeTransformerFailedError(f"Error converting input '{k}' at position {i}:\n {exc}") from None
return kwargs

@classmethod
Expand Down

0 comments on commit 243e1be

Please sign in to comment.