apache/spark — pull request #2895 by tdhopper (2014-10-22 19:57:29+00:00)
Title: Clarify docstring for Pyspark's foreachPartition

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
```