Description: Be compatible with pandas 3 Origin: upstream eb27cf084a90e545c10f8a5435d7f17cf1d28ff9 (part) Bug-Debian: https://bugs.debian.org/1142518 Author: Theelx Forwarded: not-needed --- a/jsonpickle/ext/pandas.py +++ b/jsonpickle/ext/pandas.py @@ -247,7 +247,7 @@ class PandasDfHandler(BaseHandler): for col in df.columns: dtype_str = dtypes.get(col, "object") try: - dtype = np.dtype(dtype_str) + dtype = pd.api.types.pandas_dtype(dtype_str) df[col] = df[col].astype(dtype) except Exception: msg = ( --- a/jsonpickle/tags_pd.py +++ b/jsonpickle/tags_pd.py @@ -213,6 +213,14 @@ def get_all_pandas_dtype_strings(): # use the class object for things that np.dtype can't reconstruct dtypes.extend([pd.Timestamp, pd.Timedelta, pd.Period, pd.Interval]) + # include parameterized extension dtypes with storage-specific names + # this is required for pandas 3.0.0 + for storage in ["python", "pyarrow"]: + try: + dtypes.append(str(pd.StringDtype(storage=storage)).lower()) # type: ignore[call-overload] + except Exception: + pass + return list(dict.fromkeys(dtypes))