Uh oh!
There was an error while loading. Please reload this page.
Clarify docstring for Pyspark's foreachPartition - #2895
Conversation
Due to the underlying use of `mapPartitions` which requires a function that maps partitions to partitions, `foreachPartition` requires the function passed to be a generator function or return an iterable (although these results are discarded). This is currently not stated in the documentation except through the unexplained example. It would help users to understand that example and not waste time with this error: ``` TypeError: 'NoneType' object is not iterable ```
AmplabJenkins
commented
Oct 22, 2014
Can one of the admins verify this patch? |
JoshRosen
commented
Oct 22, 2014
Actually, we might want to just fix this and allow |
tdhopper
commented
Oct 23, 2014
Oh. Now that I look at master, @JoshRosen, I see that it's already been fixed by @davishere. The fix just isn't in 1.1. I guess we should close this? |
JoshRosen
commented
Oct 23, 2014
Maybe we can backport SPARK-2871 to 1.1, since it looks like it also fixes a bunch of preservesPartitioning bugs. |
JoshRosen
commented
Oct 23, 2014
davies
commented
Oct 23, 2014
@JoshRosen It will be better if we could easily backport them. |
tdhopper
commented
Oct 23, 2014
I'd love to see this happen. |
davis
commented
Oct 23, 2014
Ah - tdhopper, i think you meant @davies :) |
JoshRosen
commented
Oct 23, 2014
JoshRosen
commented
Oct 23, 2014
(Imagine what |
JoshRosen
commented
Dec 16, 2014
If you don't mind, could you close this PR since it has been subsumed by another commit? If we want to track the progress / backport status of a different fix, then we should do that in JIRA. |
tdhopper
commented
Dec 16, 2014
@JoshRosen: Yup. Thanks. |
Due to the underlying use of
mapPartitionswhich requires a function that maps partitions to partitions,foreachPartitionrequires the function passed to be a generator function or return an iterable (although these results are discarded).This is currently not stated in the documentation except through the unexplained example. It would help users to understand that example and not waste time with this error: