From c5f36e22f353814803a7a6c522a020b127e4e759 Mon Sep 17 00:00:00 2001 From: heoh Date: Sat, 25 Oct 2025 07:02:41 +0000 Subject: [PATCH 1/2] BUG: Recognize tuple state without attrs dict --- pandas/_libs/arrays.pyx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandas/_libs/arrays.pyx b/pandas/_libs/arrays.pyx index 2932f3ff56396..584d0c14a21f8 100644 --- a/pandas/_libs/arrays.pyx +++ b/pandas/_libs/arrays.pyx @@ -100,6 +100,9 @@ cdef class NDArrayBacked: if len(state) == 1 and isinstance(state[0], dict): self.__setstate__(state[0]) return + elif len(state) == 2: + self.__setstate__((*state, {})) + return raise NotImplementedError(state) # pragma: no cover data, dtype = state[:2] From 1e6cd2f0ee6ed551bea0fcbd854d71312317299c Mon Sep 17 00:00:00 2001 From: heoh Date: Sat, 25 Oct 2025 19:51:23 +0000 Subject: [PATCH 2/2] Add description comment for related issue --- pandas/_libs/arrays.pyx | 1 + 1 file changed, 1 insertion(+) diff --git a/pandas/_libs/arrays.pyx b/pandas/_libs/arrays.pyx index 584d0c14a21f8..6af01a7f6e6ae 100644 --- a/pandas/_libs/arrays.pyx +++ b/pandas/_libs/arrays.pyx @@ -101,6 +101,7 @@ cdef class NDArrayBacked: self.__setstate__(state[0]) return elif len(state) == 2: + # GH#62820: Handle missing attrs dict during auto-unpickling self.__setstate__((*state, {})) return raise NotImplementedError(state) # pragma: no cover