From edcefef14f27d5c228cf7962b0f069ee66e5bb3b Mon Sep 17 00:00:00 2001 From: Samhita Alla Date: Fri, 8 Jul 2022 18:40:06 +0530 Subject: [PATCH] add unit test Signed-off-by: Samhita Alla --- tests/flytekit/unit/core/test_type_hints.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/flytekit/unit/core/test_type_hints.py b/tests/flytekit/unit/core/test_type_hints.py index 077b19f8b5..df07c03a62 100644 --- a/tests/flytekit/unit/core/test_type_hints.py +++ b/tests/flytekit/unit/core/test_type_hints.py @@ -16,7 +16,7 @@ from dataclasses_json import dataclass_json from google.protobuf.struct_pb2 import Struct from pandas._testing import assert_frame_equal -from typing_extensions import Annotated +from typing_extensions import Annotated, get_origin import flytekit import flytekit.configuration @@ -89,6 +89,14 @@ def my_task(a: int) -> typing.NamedTuple("OutputsBC", b=typing.ForwardRef("int") assert context_manager.FlyteContextManager.size() == 1 +def test_annotated_namedtuple_output(): + @task + def my_task() -> typing.NamedTuple("OutputA", a=Annotated[int, "metadata-a"]): + return 1 + + assert get_origin(my_task.python_interface.outputs["a"]) is Annotated + + def test_simple_input_no_output(): @task def my_task(a: int):