Fix the incorrect serialization behavior with pickle (#5960)

This commit is contained in:
Siyuan (Ryans) Zhuang
2019-10-22 18:08:36 -07:00
committed by Philipp Moritz
parent b6e7ed20ce
commit 95241f6686
2 changed files with 29 additions and 1 deletions
+4
View File
@@ -2090,6 +2090,10 @@ def _register_custom_serializer(cls,
"Exactly one of use_pickle, use_dict, or serializer/deserializer must "
"be specified.")
if worker.use_pickle and serializer is None:
# In this case it should do nothing.
return
if use_dict:
# Raise an exception if cls cannot be serialized efficiently by Ray.
serialization.check_serializable(cls)