Github user nchammas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14579#discussion_r74307747
  
    --- Diff: python/pyspark/rdd.py ---
    @@ -221,6 +227,21 @@ def context(self):
         def cache(self):
             """
             Persist this RDD with the default storage level (C{MEMORY_ONLY}).
    +
    +        :py:meth:`cache` can be used in a 'with' statement. The RDD will 
be automatically
    +        unpersisted once the 'with' block is exited. Note however that any 
actions on the RDD
    +        that require the RDD to be cached, should be invoked inside the 
'with' block; otherwise,
    +        caching will have no effect.
    --- End diff --
    
    Agreed, especially since this is technically a new Public API that we are 
potentially committing to for the life of the 2.x line.


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

Reply via email to