Skip to content

Commit

Permalink
Added docstring to explain serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
arnavgarg1 committed Sep 15, 2022
1 parent 05156c8 commit 49b4169
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ludwig/hyperopt/syncer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ def _delete_command(self, uri: str) -> Tuple[Callable, Dict]:
dict(uri=uri),
)

# Custom deserialization needed since we can't pickle thread.lock objects
def __reduce__(self):
"""We need this custom serialization because we can't pickle thread.lock objects that are used by the
use_credentials context manager."""
deserializer = RemoteSyncer
serialized_data = (self.sync_period, self.backend)
return deserializer, serialized_data

0 comments on commit 49b4169

Please sign in to comment.