From 2ad302825efd85e16d3d4fd0e34d1c13145dc133 Mon Sep 17 00:00:00 2001 From: ArrayRecord Team Date: Fri, 25 Oct 2024 09:36:20 -0700 Subject: [PATCH] Internal change PiperOrigin-RevId: 689816922 --- python/array_record_data_source.py | 7 +++++++ 1 file changed, 7 insertions(+) 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."""