lidavidm commented on a change in pull request #29818:
URL: https://github.com/apache/spark/pull/29818#discussion_r544710042



##########
File path: python/pyspark/sql/tests/test_arrow.py
##########
@@ -191,6 +191,32 @@ def test_pandas_round_trip(self):
         pdf_arrow = df.toPandas()
         assert_frame_equal(pdf_arrow, pdf)
 
+    def test_pandas_self_destruct(self):
+        import pyarrow as pa
+        rows = 2 ** 16
+        cols = 8
+        df = self.spark.range(0, rows).select(*[rand() for _ in range(cols)])
+        expected_bytes = rows * cols * 8
+        with 
self.sql_conf({"spark.sql.execution.arrow.pyspark.selfDestruct.enabled": True}):
+            # We hold on to the table reference here, so if self destruct 
didn't work, then
+            # there would be 2 copies of the data (one in Arrow, one in 
Pandas), both
+            # tracked by the Arrow allocator

Review comment:
       Makes sense to me - I'll try to update this soon. Thanks for being 
patient with me here.
   
   Also looks like the 3.1 branch was cut already, so I need to update the 
flags here to reference 3.2.




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



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

Reply via email to