zhengruifeng commented on code in PR #53059:
URL: https://github.com/apache/spark/pull/53059#discussion_r2729858066
##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -169,6 +169,12 @@ def __reduce__(self) -> Tuple:
},
)
+ def __getstate__(self) -> Any:
+ return self.__dict__.copy()
+
+ def __setstate__(self, state: Any) -> None:
Review Comment:
withtout `__setstate__`, `test_connect_basic` fails with
```
======================================================================
ERROR [0.011s]: test_serialization
(__main__.SparkConnectBasicTests.test_serialization)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/Users/ruifeng.zheng/spark/python/pyspark/sql/tests/connect/test_connect_basic.py",
line 143, in test_serialization
cdf2 = loads(data)
TypeError: 'Column' object is not callable
======================================================================
ERROR [0.012s]: test_serialization_II
(__main__.SparkConnectBasicTests.test_serialization_II)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/Users/ruifeng.zheng/spark/python/pyspark/sql/tests/connect/test_connect_basic.py",
line 153, in test_serialization_II
cdf2 = pickle_ser.loads(data)
File "/Users/ruifeng.zheng/spark/python/pyspark/serializers.py", line 461,
in loads
return cloudpickle.loads(obj, encoding=encoding)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'Column' object is not callable
----------------------------------------------------------------------
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]