Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
Signed-off-by: Yee Hing Tong <[email protected]>
  • Loading branch information
wild-endeavor committed Oct 25, 2021
1 parent 39b0e46 commit 83d7992
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/flytekit/unit/core/test_flyte_pickle.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections import OrderedDict
from typing import List
from typing import List, Dict

from flytekit.common.translator import get_serializable
from flytekit.core import context_manager
Expand Down Expand Up @@ -60,3 +60,20 @@ def t1(a: int) -> List[List[Foo]]:

task_spec = get_serializable(OrderedDict(), serialization_settings, t1)
print(task_spec)

# Return signature should be a literal collection of a literal collection of Pickle type.


def test_nested2():
class Foo(object):
def __init__(self, number: int):
self.number = number

@task
def t1(a: int) -> List[Dict[str, Foo]]:
return [{"a": Foo(number=a)}]

task_spec = get_serializable(OrderedDict(), serialization_settings, t1)
print(task_spec)

# Return signature should be a literal collection of a literal map of Pickle type.

0 comments on commit 83d7992

Please sign in to comment.