Wonder if something changed with chaining tasks us...
# ask-the-community
l
Wonder if something changed with chaining tasks using
>>
? Seeing this error when trying to chain tasks inside a dynamic task
Copy code
File "/usr/local/lib/python3.9/site-packages/flytekit/core/promise.py", line 297, in __rshift__
        if not self.is_ready and other.ref:

Message:

    'Output' object has no attribute 'ref'
but I can't reproduce it in a basic example.. 😕
y
can you paste your current example redacted?
that code hasn’t really changed in a while, but maybe something touched it in an edge case?
l
let me try. It's something with the 1.9.0/1 bc when I rolled back my flytekit docker to 1.8.1; it was ok.
Ok i have a minimal examppe
kind of
y
did you delete something?
l
yea...my minimal example started working instead of breaking when I put it all in one file lolcry instead of importing from diff files
😮 its when the output is of type Tuple.
y
so when you have multiple outputs
l
Copy code
from flytekit import dynamic, task, workflow
from typing import Tuple

@task
def task_2(
    condition: bool
) -> str:
    return str(condition)

@task
def task_3(
    condition: bool
) -> Tuple[str, str]:
    return str(condition), str(not condition)
    

@dynamic
def dynamic_1(
    condition: bool
):
    job3 = task_2(
        condition=condition
    )
    job4 = task_3(
        condition=condition
    )
    job3 >> job4


@workflow
def wf_2(
    condition: bool
):
    dynamic_1(
        condition=condition
    )
y
hmm,
but it works presumably if you do
Copy code
job4, job5 = task_3(
            condition=condition
        )
l
ok i pruned a little bit; since the other tasks weren't relevant to this
let me try.
yes. that fixes it
Copy code
job4, job5 = task_3(
        condition=condition
    )
    job3 >> job4
y
i think that’s the right way to call it though
k
The same happens with a NamedTuple, what is the suggested way here?
Copy code
@task
def task1() -> None:
    print("Task1")

Task2Out = NamedTuple("Task2Out", out1=int, out2=int)

@task
def task2() -> Task2Out:
    return Task2Out(1, 2)


@workflow
def demo_wf() -> None:
    out1 = task1()
    out2 = task2()

    out1 >> out2
y
try
Copy code
out1 >> out2.out1
k
That't it, thanks!