[BUG] Unpickling objects with pd.read_pickle()
doesn't work with cudf.pandas enabled
#15459
Labels
1 - On Deck
To be worked on next
bug
Something isn't working
cudf.pandas
Issues specific to cudf.pandas
Milestone
Describe the bug
When
cudf.pandas
is enabled, we can pickle and unpickle objects usingpickle.dump/load
orpickle.dumps/loads
. But if we choose to unpickle withpd.read_pickle
, things go awry. Here's a minimal reproducer:We can (and do) control what happens when objects are pickled and unpickled via the pickle protocol (
pickle.dump
andpickle.load
) here.And pandas'
read_pickle
does call the "regular"pickle.load
function.So what's going on?
When we call
pd.read_pickle
incudf.pandas
mode, that will first callcudf.read_pickle
(doesn't exist) and then fall back to the realpandas.read_pickle
. Importantly, during fallback, we disable ourselves. Which means that our special pickle protocol handling doesn't kick in and that messes everything up.Solutions
The only solution I could think of is we vendor
pandas.read_pickle
, so we can keep ourselves enabled when it is called.The text was updated successfully, but these errors were encountered: