From a6375a0bded8a52d359f940108868dbd10e175bf Mon Sep 17 00:00:00 2001 From: Matthew Murray Date: Thu, 27 Jun 2024 12:08:22 -0700 Subject: [PATCH] register pickle functions as proxy funcs --- python/cudf/cudf/pandas/_wrappers/pandas.py | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/python/cudf/cudf/pandas/_wrappers/pandas.py b/python/cudf/cudf/pandas/_wrappers/pandas.py index 0ba432d6d0e..12da89115f5 100644 --- a/python/cudf/cudf/pandas/_wrappers/pandas.py +++ b/python/cudf/cudf/pandas/_wrappers/pandas.py @@ -891,6 +891,28 @@ def Index__new__(cls, *args, **kwargs): _eval_func = _FunctionProxy(_Unusable(), pd.eval) +_read_pickle_func = _FunctionProxy(_Unusable(), pd.read_pickle) + +_to_pickle_func = _FunctionProxy(_Unusable(), pd.to_pickle) + +@register_proxy_func(pd.read_pickle) +def _read_pickle( + filepath_or_buffer, + compression = "infer", + storage_options = None, +): + return _read_pickle_func(filepath_or_buffer, compression, storage_options) + + +@register_proxy_func(pd.to_pickle) +def _to_pickle( + *args, + **kwargs, +): + return _to_pickle_func( + *args, + **kwargs, + ) def _get_eval_locals_and_globals(level, local_dict=None, global_dict=None): frame = sys._getframe(level + 3)