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
map() preserving the order is much more intuitive behavior. Python's builtin Pool executor, ray, joblib, etc. all work in such a way.
I realized that one can still pipe to pl.process.ordered, but the documentation is limited and this is quite difficult to use.
defslow_identity(x):
time.sleep(random.random())
returnxs=list(range(100)) |pl.process.map(slow_identity, workers=N)
list(s) # should be ordered by default
The text was updated successfully, but these errors were encountered:
Implementing ordering efficiently can get very tricky if you consider multi-stage pipelines containing transformations like filter and flat_map. The current implementation of ordered is pessimistic and has to wait for all the elements to come in before yielding.
I think the example from the ordered documentation should be able for people to get started, but would be happy to improve if you give some feedback.
I don't agree that stages should order by default since its a slower operation. We can optimize ordered for simple cases and add ordered shortcut flag to map.
map()
preserving the order is much more intuitive behavior. Python's builtin Pool executor, ray, joblib, etc. all work in such a way.I realized that one can still pipe to
pl.process.ordered
, but the documentation is limited and this is quite difficult to use.The text was updated successfully, but these errors were encountered: