GitHub user tdhopper opened a pull request:
https://github.com/apache/spark/pull/2895
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
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tdhopper/spark patch-1
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/2895.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2895
----
commit e22f753ebcd5c7f44f9699481ad26d2263290097
Author: Timothy Hopper <[email protected]>
Date: 2014-10-22T19:56:19Z
Clarify docstring for 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
```
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]