diff --git a/ludwig/hyperopt/syncer.py b/ludwig/hyperopt/syncer.py index 276a417363b..c47b1b9fc82 100644 --- a/ludwig/hyperopt/syncer.py +++ b/ludwig/hyperopt/syncer.py @@ -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