Hi all! I have this workflow: ```@task def generat...
# flyte-support
i
Hi all! I have this workflow:
Copy code
@task
def generate_directory() -> FlyteDirectory:
    # do something
    return FlyteDirectory(path=".....")

@task
def consume_directories(dirs: List[FlyteDirectory]):
     # do something with a list of directories
    return

@workflow
def wf():
    dirs = map_task(generate_directory)()
    consume_directories(dirs=dirs)
I keep getting this error:
Copy code
Failed to convert inputs of task    
                         'wf.consume_directories':                         
                           'NoneType' object has no attribute 'uri'
is it not allowed to use the output of a map task if it was list of FlyteDirectory? flytekit version: 1.13.4
t
this should work. can you check the output of the map task?
is there a None in the list somewhere?
i
So I am running locally, is map task ignored in this case ?
cuz I suspect that the outputs get overwritten , but the all outputs reference the same uri, so somehow, other outputs are None or so.. not sure just guessing
t
no the map task should still work.
can you remove the downstream task and confirm see if the output is what you expect just from the map task? is that easy to do?
i
yes, FlyteDirectories are returned, and uploaded to remote_directory.. and the promise value shows 2 items (in case of 2 item map_task) , but fails on the next task
t
will try to repro in a bit…
i
thank s
t
actually i can’t repro this.
Untitled
can you try that? and if it works, can you try to understand what the delta is between your example and this one?
at the very least we can improve on our error messaging.
i
thank you, I figured out with the issue is, the problem is with
min_success_ratio
: you need to expect a failed pod in the next task, so the
consume_dir
should expect
List[Optional[FlyteDirectory]]
t
ah nice, thanks good catch. let me try that and see what error i get, we will make the error more clear.
may or may not add this. one thing to note nizar, if you had tried to register or run this workflow (with the ratio) on a live backend, it would’ve failed because technically there’s a compilation error.
flytekit relies on the backend compiler to detect type mis-matches.
we’re debating adding a local check for this in flytekit itself.
i
Yes its not registering, any idea how to fix this?
A workaround
t
add the optional?
i
nvm, protobuf needed an update.