def cache(self):
        """
        Enable in-memory caching (Spark only).
        """
        if self.mode == 'spark':
            self.values.cache()
            return self
        else:
            notsupported(self.mode)
Enable in-memory caching (Spark only).