What replaces the old `flatten` call in Prefect 2....
# prefect-community
t
What replaces the old
flatten
call in Prefect 2.0? I have a list of lists after mapping tasks and I used to be able to use
flatten
to coalesce that into a single large list.
👀 1
t
interessted in this to... currently i do it by myself...but would be great if there will be something out of the box
Copy code
flatten_files = [
        file
        for unzipped_file in unzipped_files
        for file in unzipped_file.wait().result()
    ]
✅ 1
a
I think Timos approach seems like the right approach. Given that you can run any Python now, flatten is no longer really required but if you want to, you can open a feature request on GitHub and describe why doing it in Python without extra abstraction doesn't work for you and what the proposed alternative would look like. It would be better to not think how this is tackled in 1.0 but rather what you think the right solution would look like if you wouldn't know 1.0 before. Thanks in advance