ueshin commented on a change in pull request #24070: [SPARK-23961][PYTHON] Fix 
error when toLocalIterator goes out of scope
URL: https://github.com/apache/spark/pull/24070#discussion_r270310387
 
 

 ##########
 File path: python/pyspark/rdd.py
 ##########
 @@ -2386,7 +2425,7 @@ def toLocalIterator(self):
         """
         with SCCallSiteSync(self.context) as css:
             sock_info = 
self.ctx._jvm.PythonRDD.toLocalIteratorAndServe(self._jrdd.rdd())
-        return _load_from_socket(sock_info, self._jrdd_deserializer)
+        return iter(_PyLocalIterable(sock_info, self._jrdd_deserializer))
 
 Review comment:
   How about making a method instead of exposing `_PyLocalIterable`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to