Skip to content

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
Signed-off-by: Yicheng-Lu-llll <[email protected]>
  • Loading branch information
Yicheng-Lu-llll committed Mar 11, 2023
1 parent f6e17dd commit debcfed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flytekit/core/type_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,10 +985,10 @@ def to_literal(self, ctx: FlyteContext, python_val: T, python_type: Type[T], exp
if type(python_val) != list:
raise TypeTransformerFailedError("Expected a list")

if self.is_batchable(python_type):
if ListTransformer.is_batchable(python_type):
batchSize = len(python_val) # default batch size
# parse annotated to get the number of items saved in a pickle file.
if get_origin(python_type) is Annotated:
if get_origin(python_type) is Annotated and type(get_args(python_type)[1]) == int:
batchSize = get_args(python_type)[1]
lit_list = [TypeEngine.to_literal(ctx, python_val[i : i + batchSize], FlytePickle, expected.collection_type) for i in range(0, len(python_val), batchSize)] # type: ignore
else:
Expand Down

0 comments on commit debcfed

Please sign in to comment.