New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
task mapping on generators? #2023
Comments
Hey @mohamed--abdel-maksoud the core development team has a plan in the works for a larger mapping refactor to better support some use cases we have seen arise as well as enable the addition of new features. This may end up solving your use case but I can't say for certain. That being said the reason why mapping over generators is not currently supported is due to the nature of Prefect requiring tasks to finish and return pickleable results for their downstream tasks. |
Thanks @joshmeek for the quick answer, I'll wait for the refactoring then. |
@joshmeek I also ran into this. I'm interested to see how you solve it. My use case: I have a task which preforms an unbounded task (looping over request pages) and generates results which a downstream task will process without blocking. Looking at the code; It's fairly straight forward to modify Anyway, I hope that adds something to the conversation. Thanks for working on this hard problem and making my development easier! |
@joshmeek is there any timeline for this? |
Chiming in for josh here -- there is currently no timeline for this although it is something we are increasingly interested in undertaking! The implementation will most likely be more general than mapping over generators, and allow for a "parent" task to asynchronously spawn new tasks that can immediately begin running (under the right executor). I will update here if and when this enters the planning phases. |
Feature: using same feature flags check as nebula
@joshmeek Seems this issue was closed by mistake (commit references pull request 2023, not issue 2023). Any general support for generators still on the table? |
@sveinugu that commit is indeed unrelated but this was closed long ago by the opener of the issue. I believe mapping over generators is supported in Prefect v2. |
Is there a reason why we can't pass a generator expression to
task.map
? loading the whole list in memory is potentially inefficient.If what is needed is just development time, I'd like to work on it.
The text was updated successfully, but these errors were encountered: