rich-garden-69988
05/17/2022, 10:56 PMmypy
and have this issue with NamedTuple
(for named outputs). The example in the docs (shown below) fails mypy 0.910
Code from Flyte docs:
import typing
from flytekit import task
hello_output = typing.NamedTuple("OP", greet=str)
@task
def say_hello() -> hello_output:
return hello_output("hello world")
Error:
mint/workflows/tmp.py:5:16: error: Unexpected arguments to namedtuple() [misc]
hello_output = typing.NamedTuple("OP", greet=str)
^
mint/workflows/tmp.py: note: In function "say_hello":
mint/workflows/tmp.py:10:12: error: Too many arguments for "hello_output" [call-arg]
return hello_output("hello world")
^
rich-garden-69988
05/17/2022, 10:56 PMtype: ignore
for now and we can bring this up to the mypy
people?tall-lock-23197
hello_output = typing.NamedTuple("hello_output", [("greet", str)])
works.
@thankful-minister-83577, should we modify all the NamedTuple examples in the docs to keep them in sync with mypy?