Skip to content

Commit

Permalink
Improve error message in ListTransformer when not passing a list (fly…
Browse files Browse the repository at this point in the history
…teorg#1882)

Signed-off-by: Fabio Grätz <[email protected]>
Co-authored-by: Fabio Grätz <[email protected]>
  • Loading branch information
fg91 and Fabio Grätz authored Oct 10, 2023
1 parent 8cf2e0b commit 3afcbb4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion flytekit/core/type_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,12 @@ def to_python_value(self, ctx: FlyteContext, lv: Literal, expected_python_type:
try:
lits = lv.collection.literals
except AttributeError:
raise TypeTransformerFailedError()
raise TypeTransformerFailedError(
(
f"The expected python type is '{expected_python_type}' but the received Flyte literal value "
f"is not a collection (Flyte's representation of Python lists)."
)
)
if self.is_batchable(expected_python_type):
from flytekit.types.pickle import FlytePickle

Expand Down

0 comments on commit 3afcbb4

Please sign in to comment.