Hey, is this supposed to work? It works for me on the cluster but not locally (ie. just running it with python), in tk_agg the list items are promises instead of Something instances (so x.n fails)
Copy code
from flytekit import dynamic, task, workflow
class Something:
n: int
@task
def tk_inner() -> Something:
s = Something()
s.n = 3
return s
@task
def tk_agg(s: list[Something]) -> int:
return sum(x.n for x in s)
@dynamic
def tk_outer() -> int:
s = [tk_inner() for _ in range(5)]
return tk_agg(s=s)
@workflow
def wf_outer() -> int:
return tk_outer()
assert wf_outer() == sum(range(5))
👀 1
f
freezing-airport-6809
06/12/2023, 1:25 PM
It is supposed to work. This seems like a flytekit local executor bug. Cc @thankful-minister-83577 : @glamorous-carpet-83516 can either of you take a look
t
thankful-minister-83577
06/14/2023, 4:57 PM
What’s the Something? Is it something that gets pickled?
thankful-minister-83577
06/14/2023, 4:57 PM
and what’s the error? can you paste?
e
elegant-petabyte-32634
06/16/2023, 7:16 PM
all the code is there including the class Something, should be able to just run that script. the error was that it tried to call .json() which didn't exist iirc (but could be wrong), but I'm not at my pc atm to check
elegant-petabyte-32634
06/16/2023, 7:17 PM
ah no nvm it was because the list items were still promises