Thread
#announcements
    Mike Ossareh

    Mike Ossareh

    4 months ago
    I'm getting a typing complaint while writing an integration test for a workflow: ๐Ÿงต
    This is broadly the test case:
    from our.codebase.task import task, OurParameterType, OurTaskResult
    
    def test_our_task():
        @workflow
        def do_workflow(arg1: FlyteDirectory, arg2: OurParameterType) -> OurTaskResult:
            return task(arg1, arg2)
    
        arg1 = foo
        arg2 = bar
    
        ret: OurTaskResult = do_workflow(arg1, arg2)
    Two typing issues occur:1.
    no parameter named arg2
    2.
    VoidPromise is incompatible with OurTaskResult
    In the case of #1, is this some byproduct of the decorator? in the case of #2 should the return type of
    do_work
    be something else?
    OurTaskResult
    is essentially a:
    @dataclass_json
    @dataclass
    class FlyteResult:
      result: <our dc>
    Where
    our dc
    is passed during module evaluation
    Eduardo Apolinario (eapolinario)

    Eduardo Apolinario (eapolinario)

    4 months ago
    @Mike Ossareh. in the case of #1, workflows and tasks only accept named arguments. Can you try replacing the invocation of
    do_workflow
    with:
    do_workflow(arg1=arg1, arg2=arg2)
    As for #2, this is a byproduct of the flytekit decorators. I think we can do something there, but will require a few changes.
    Mike Ossareh

    Mike Ossareh

    4 months ago
    Thanks @Eduardo Apolinario (eapolinario) - we actually are passing with keyword args - sorry, that was just me not being precise in my example
    and the definition:
    Eduardo Apolinario (eapolinario)

    Eduardo Apolinario (eapolinario)

    4 months ago
    got it, thanks for clarifying. And just so I understand, the test fails or this is about the types not matching (and mypy complaining)?
    Mike Ossareh

    Mike Ossareh

    4 months ago
    mypy compaints
    or, in this case, pyright
    test passes just fine
    Eduardo Apolinario (eapolinario)

    Eduardo Apolinario (eapolinario)

    4 months ago
    got it. Yeah, we'll need to make some changes to the workflow decorator to ensure mypy/pyright is happy.
    Can you file an issue?
    Mike Ossareh

    Mike Ossareh

    4 months ago
    Will do
    Eduardo Apolinario (eapolinario)

    Eduardo Apolinario (eapolinario)

    4 months ago
    thank you!
    Mike Ossareh

    Mike Ossareh

    4 months ago
    @Eduardo Apolinario (eapolinario) is this a bug or housekeeping? Feels like housekeeping honestly because things work
    Eduardo Apolinario (eapolinario)

    Eduardo Apolinario (eapolinario)

    4 months ago
    Mike Ossareh

    Mike Ossareh

    4 months ago
    Eduardo Apolinario (eapolinario)

    Eduardo Apolinario (eapolinario)

    4 months ago
    Amazing, thanks. Will ping here when we figure out priorities. In the meantime, if you want to take a crack at it, please feel free.