Laura Lin
10/12/2023, 8:12 PM>>
? Seeing this error when trying to chain tasks inside a dynamic task
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'
Yee
Laura Lin
10/12/2023, 11:15 PMYee
Laura Lin
10/12/2023, 11:32 PMYee
Laura Lin
10/12/2023, 11:35 PMfrom 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
)
Yee
job4, job5 = task_3(
condition=condition
)
Laura Lin
10/12/2023, 11:38 PMjob4, job5 = task_3(
condition=condition
)
job3 >> job4
Yee
Klemens Kasseroller
11/22/2023, 2:24 PM@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
Yee
out1 >> out2.out1
Klemens Kasseroller
11/23/2023, 7:59 AM