Github user holdenk commented on the issue: https://github.com/apache/spark/pull/14579 @nchammas so if we go with the subclassing approach but keep the current cache/persist interface (e.g. no special utility function) a user could easily write something like: `magic = rdd.persist() with magic as awesome: awesome.count() magic.map(lambda x: x + 1)` I don't _believe_ `__exit__()` could easily return a result that would updated `magic` to be `rdd` (infact `__exit__()` generally doesn't seem to return a result - instead its expected to do the teardown logic internally).
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org