HyukjinKwon commented on code in PR #46002:
URL: https://github.com/apache/spark/pull/46002#discussion_r1562000621
##########
python/pyspark/cloudpickle/cloudpickle.py:
##########
@@ -1461,7 +1461,7 @@ def dump(obj, file, protocol=None, buffer_callback=None):
Pickler(file, protocol=protocol, buffer_callback=buffer_callback).dump(obj)
-def dumps(obj, protocol=None, buffer_callback=None):
+def dumps(obj, protocol=None, buffer_callback=None, dispatch_handlers=None):
Review Comment:
Instead of fixing here, could we just do it within PySpark side? e.g., at
`CloudPickleSerializer`
```python
with io.BytesIO() as file:
cp = Pickler(file, protocol=protocol,
buffer_callback=buffer_callback)
# Register custom dispatch handlers. This allows per object
customization of
# the serialization.
if dispatch_handlers is not None:
for klass, handler in dispatch_handlers.items():
cp.dispatch_table[klass] = handler
cp.dump(obj)
return file.getvalue()
```
--
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]