Hey, is this supposed to work? It works for me on ...
# ask-the-community
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

def tk_inner() -> Something:
    s = Something()
    s.n = 3
    return s

def tk_agg(s: list[Something]) -> int:
    return sum(x.n for x in s)

def tk_outer() -> int:
    s = [tk_inner() for _ in range(5)]
    return tk_agg(s=s)

def wf_outer() -> int:
    return tk_outer()

assert wf_outer() == sum(range(5))
It is supposed to work. This seems like a flytekit local executor bug. Cc @Yee : @Kevin Su can either of you take a look
What’s the Something? Is it something that gets pickled?
and what’s the error? can you paste?
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
ah no nvm it was because the list items were still promises
In tk_agg