rangadi commented on code in PR #46125:
URL: https://github.com/apache/spark/pull/46125#discussion_r1572997060
##########
python/pyspark/sql/tests/connect/streaming/test_parity_foreach_batch.py:
##########
@@ -66,6 +66,30 @@ def func(df, _):
q = df.writeStream.foreachBatch(func).start()
q.processAllAvailable()
+ def test_pickling_deserialization_error(self):
+ class NoUnpickle:
+ def __init__(self, data):
+ self.data = data
+
+ def __reduce__(self):
+ # Serialize only the data attribute
+ return (self.__class__, (self.data,))
Review Comment:
I think here, you should return a function that throws.
```
def __reduce__(self):
reurn (error_fn, ())
def error_fn:
raise ...
```
--
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]