-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Preserve task dependencies to futures passed as parameters in .map
#6701
Preserve task dependencies to futures passed as parameters in .map
#6701
Conversation
❌ Deploy Preview for prefect-orion failed.Built without sensitive environment variables
|
@madkinsz Have pushed a commit that passes all the test cases. It obviously uses I don't love that I had to add a special case to I also found some tests in the same file that test relationships but only via values returned, I believe my tests would sit better next to them. As a side note, have you considered breaking up this file? It's really quite large and hard to orient/find things in. |
Hi again! Here's a commit that:
See 00d8647 I did not remove any of the functions you introduced and there may be some additional polish here. Are you interested in cherry-picking that commit into here and cleaning things up?
I'd prefer to keep all the mapping tests separate from those other inputs tests for now since they're a special case. If you want to create a
We haven't yet! It seems reasonable in the long run but I mostly just navigate by class. We don't have strong norms about using classes vs files. I think I'd prefer files as we grow the test suite though. |
Ah, that makes so much sense! The nesting was giving me a massive headache, but it didn't need to be! Feels obvious looking at it..... 😄
Yes very happy to tidy up!
Noted, will split into its own section. |
9f0b164
to
0b4ec68
Compare
Excellent work! Since I wrote some of this I'm going to request @bunchesofdonald as a reviewer. This looks good to me though. |
@madkinsz thank you for your guidance on this! Not sure I can claim to have done too much of it, but glad to have helped it along! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks great! That test suite is fantastic.
@@ -795,15 +801,14 @@ async def begin_task_map( | |||
wait_for=wait_for, | |||
return_type=return_type, | |||
task_runner=task_runner, | |||
extra_task_inputs=task_inputs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not excited about extra_task_inputs
, but I also can't think of a better approach at the moment. It may point at a possible need to refactor the way we validate the parameters to a map call or the way we gather at task inputs at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah me neither. I think ideally we have a way to track lengths on futures and create indexed children of futures. When the future has no known length, we resolve it to determine the length for mapping then access its indices (which creates child futures) that we pass downstream. That way, our existing tracking will work.
That said, users want to create dependencies between tasks in their graph without necessarily waiting for them to finish. extra_task_inputs
may be useful for user-defined relationships that do not have runtime implications.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @WillRaphaelson for reference
76b0058
to
835fd04
Compare
@madkinsz do you require any more action from me to get this merged? all tests are passing, netlify seems to be failing due to authentication issues to a private repo. |
See #6728 for some notes on that failure, it's expected right now. Thanks a bunch for contributing! |
Preserves relationships between a mapped task and its parameters if that parameter is a future, closes #6686.
Example
Will now correctly produce this graph:
Checklist
<link to issue>
"fix
,feature
,enhancement
,docs
, ormaintenance
label categorizing the change.