Skip to content

Commit b345298

Browse files
jbrockmendeltopper-123
authored andcommitted
REF: move SparseDtype, ArrowDtype to dtypes.dtypes (pandas-dev#53116)
* REF: move SparseDtype to dtypes.dtypes * REF: move ArrowDtype to dtypes.dtypes
1 parent bc5b9d9 commit b345298

37 files changed

+841
-875
lines changed

pandas/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
DataFrame,
109109
)
110110

111-
from pandas.core.arrays.sparse import SparseDtype
111+
from pandas.core.dtypes.dtypes import SparseDtype
112112

113113
from pandas.tseries.api import infer_freq
114114
from pandas.tseries import offsets

pandas/compat/pickle_compat.py

+4
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ def load_reduce(self):
134134
"pandas.core.indexes.base",
135135
"Index",
136136
),
137+
("pandas.core.arrays.sparse.dtype", "SparseDtype"): (
138+
"pandas.core.dtypes.dtypes",
139+
"SparseDtype",
140+
),
137141
}
138142

139143

pandas/core/api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from pandas._libs.missing import NA
88

99
from pandas.core.dtypes.dtypes import (
10+
ArrowDtype,
1011
CategoricalDtype,
1112
DatetimeTZDtype,
1213
IntervalDtype,
@@ -25,7 +26,6 @@
2526
value_counts,
2627
)
2728
from pandas.core.arrays import Categorical
28-
from pandas.core.arrays.arrow import ArrowDtype
2929
from pandas.core.arrays.boolean import BooleanDtype
3030
from pandas.core.arrays.floating import (
3131
Float32Dtype,

pandas/core/arrays/arrow/__init__.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
from pandas.core.arrays.arrow.array import ArrowExtensionArray
2-
from pandas.core.arrays.arrow.dtype import ArrowDtype
32

4-
__all__ = ["ArrowDtype", "ArrowExtensionArray"]
3+
__all__ = ["ArrowExtensionArray"]

pandas/core/arrays/arrow/array.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@
6060
import pyarrow as pa
6161
import pyarrow.compute as pc
6262

63+
from pandas.core.dtypes.dtypes import ArrowDtype
64+
6365
from pandas.core.arrays.arrow._arrow_utils import fallback_performancewarning
64-
from pandas.core.arrays.arrow.dtype import ArrowDtype
6566

6667
ARROW_CMP_FUNCS = {
6768
"eq": pc.equal,

pandas/core/arrays/arrow/dtype.py

-323
This file was deleted.

pandas/core/arrays/sparse/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
SparseArray,
99
make_sparse_index,
1010
)
11-
from pandas.core.arrays.sparse.dtype import SparseDtype
1211

1312
__all__ = [
1413
"BlockIndex",
1514
"IntIndex",
1615
"make_sparse_index",
1716
"SparseAccessor",
1817
"SparseArray",
19-
"SparseDtype",
2018
"SparseFrameAccessor",
2119
]

0 commit comments

Comments
 (0)