Github user nchammas commented on the issue:
https://github.com/apache/spark/pull/14579
Sorry, you're right, `__exit__()`'s return value is not going to be
consumed anywhere. What I meant is that `unpersist()` would return the base RDD
or DataFrame object.
But I'm not seeing the issue with the example you posted. Reformatting for
clarity:
```python
magic = rdd.persist()
with magic as awesome:
awesome.count()
magic.map(lambda x: x + 1)
```
Are you saying `magic.map()` will error? Why would it?
`magic` would be an instance of `PersistedRDD`, which in turn is a subclass
of `RDD`, which has `map()` and all of the usual methods defined, plus the
magic methods we need for the context manager.
---
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]