diff --git a/python/array_record_data_source.py b/python/array_record_data_source.py index 9ffe588..a64eb18 100644 --- a/python/array_record_data_source.py +++ b/python/array_record_data_source.py @@ -397,6 +397,13 @@ def __repr__(self) -> str: h.update(p.encode()) return f"ArrayRecordDataSource(hash_of_paths={h.hexdigest()})" + def __reduce__(self): + raise TypeError( + "ArrayRecordDataSource objects cannot be pickled because it often" + " holds references to file handles and other resources that are not" + " easily serializable." + ) + def _get_flag_value(flag: flags.FlagHolder[int]) -> int: """Retrieves the flag value or the default if run outside of absl."""