Skip to content

Commit cbf1eae

Browse files
committed
Add pandas string dtypes to legacy pickle tests.
1 parent 7eec271 commit cbf1eae

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

pandas/compat/pickle_compat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from pandas._libs.arrays import NDArrayBacked
1818
from pandas._libs.tslibs import BaseOffset
1919

20+
from pandas.core.api import StringDtype
2021
from pandas.core.arrays import (
2122
DatetimeArray,
2223
PeriodArray,
Binary file not shown.

pandas/tests/io/generate_legacy_storage_files.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ def create_pickle_data():
147147
"float": Index(np.arange(10, dtype=np.float64)),
148148
"uint": Index(np.arange(10, dtype=np.uint64)),
149149
"timedelta": timedelta_range("00:00:00", freq="30min", periods=10),
150+
"string": Index(["foo", "bar", "baz", "qux", "quux"], dtype='string'),
150151
}
151152

152153
index["range"] = RangeIndex(10)
@@ -185,6 +186,7 @@ def create_pickle_data():
185186
"dt": Series(date_range("20130101", periods=5)),
186187
"dt_tz": Series(date_range("20130101", periods=5, tz="US/Eastern")),
187188
"period": Series([Period("2000Q1")] * 5),
189+
"string": Series(["foo", "bar", "baz", "qux", "quux"], dtype="string"),
188190
}
189191

190192
mixed_dup_df = DataFrame(data)
@@ -233,6 +235,12 @@ def create_pickle_data():
233235
},
234236
index=range(5),
235237
),
238+
"string": DataFrame(
239+
{
240+
"A": Series(["foo", "bar", "baz", "qux", "quux"], dtype="string"),
241+
"B": Series(["one", "two", "one", "two", "three"], dtype="string"),
242+
}
243+
)
236244
}
237245

238246
cat = {

0 commit comments

Comments
 (0)