Skip to content

Commit 7eec271

Browse files
committed
Fix StringDtype compat with old pickles
1 parent 3550556 commit 7eec271

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/core/arrays/string_.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ def __eq__(self, other: object) -> bool:
218218
return self.storage == other.storage and self.na_value is other.na_value
219219
return False
220220

221+
def __setstate__(self, state):
222+
self.storage = state.pop('storage', 'python')
223+
self._na_value = state.pop('_na_value', libmissing.NA)
224+
221225
def __hash__(self) -> int:
222226
# need to override __hash__ as well because of overriding __eq__
223227
return super().__hash__()

0 commit comments

Comments
 (0)