You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clarification of the task graph: are futures allowed in tuples that aren't tasks? #4183
As reported by #4177, custreamz CI fails because the task graph contains tuples with future objects.
The question is if this is even allowed? Dask don't allow keys in tuples that aren't tasks. E.g. in the following ("x",) is interpreted as a literal with no dependencies:
This is a great question, thanks for asking @madsbk
I'm somewhat torn on what behavior we should have here. Based on the Dask graph spec I would expect that we shouldn't search through non-task tuples to replace Futures with their results as we don't do this for other graph keys. On the other hand, since we currently do search non-task tuples for Futures changing that behavior can break existing user code (as you mentioned in the custreamz case).
For now I'm inclined to keep our current behavior of searching non-task tuples for Futures for backwards compatibility (i.e. we merge #4178). Though longer term, I'm open to changing behavior if we don't want to special case Futures like we currently do. It'd probably be worth a deprecation cycle in that case though.
cc @jcrist who may also be interested in this topic
I do not recall when we added futures-in-tuples. I'm fine leaving it
removed for now if the only people who it affects are comfortable moving to
lists.
In principle, any time we accept user input we should probably quote
things. If a user is providing a tuple of futures we should probably turn
that into (tuple, [f1, f2, f3]) internally.
Activity
jakirkham commentedon Oct 23, 2020
cc @mrocklin @martindurant @jrbourbeau (in case any of you have thoughts 🙂)
martindurant commentedon Oct 23, 2020
From the (cu)streamz perspective, I daresay the submits can be changed to use lists instead of tuples where necessary.
jrbourbeau commentedon Oct 23, 2020
This is a great question, thanks for asking @madsbk
I'm somewhat torn on what behavior we should have here. Based on the Dask graph spec I would expect that we shouldn't search through non-task tuples to replace
Futures with their results as we don't do this for other graph keys. On the other hand, since we currently do search non-task tuples forFutures changing that behavior can break existing user code (as you mentioned in the custreamz case).For now I'm inclined to keep our current behavior of searching non-task tuples for
Futures for backwards compatibility (i.e. we merge #4178). Though longer term, I'm open to changing behavior if we don't want to special caseFutures like we currently do. It'd probably be worth a deprecation cycle in that case though.cc @jcrist who may also be interested in this topic
mrocklin commentedon Oct 27, 2020