@@ -92,10 +92,7 @@ def make_block(
92
92
93
93
values , dtype = extract_pandas_array (values , dtype , ndim )
94
94
95
- from pandas .core .internals .blocks import (
96
- DatetimeTZBlock ,
97
- ExtensionBlock ,
98
- )
95
+ from pandas .core .internals .blocks import ExtensionBlock
99
96
100
97
if klass is ExtensionBlock and isinstance (values .dtype , PeriodDtype ):
101
98
# GH-44681 changed PeriodArray to be stored in the 2D
@@ -107,16 +104,6 @@ def make_block(
107
104
dtype = dtype or values .dtype
108
105
klass = get_block_type (dtype )
109
106
110
- elif klass is DatetimeTZBlock and not isinstance (values .dtype , DatetimeTZDtype ):
111
- # pyarrow calls get here
112
- values = DatetimeArray ._simple_new (
113
- # error: Argument "dtype" to "_simple_new" of "DatetimeArray" has
114
- # incompatible type "Union[ExtensionDtype, dtype[Any], None]";
115
- # expected "Union[dtype[datetime64], DatetimeTZDtype]"
116
- values ,
117
- dtype = dtype , # type: ignore[arg-type]
118
- )
119
-
120
107
if not isinstance (placement , BlockPlacement ):
121
108
placement = BlockPlacement (placement )
122
109
@@ -146,48 +133,3 @@ def maybe_infer_ndim(values, placement: BlockPlacement, ndim: int | None) -> int
146
133
else :
147
134
ndim = values .ndim
148
135
return ndim
149
-
150
-
151
- def __getattr__ (name : str ):
152
- # GH#55139
153
- import warnings
154
-
155
- if name in [
156
- "Block" ,
157
- "ExtensionBlock" ,
158
- "DatetimeTZBlock" ,
159
- "create_block_manager_from_blocks" ,
160
- ]:
161
- # GH#33892
162
- warnings .warn (
163
- f"{ name } is deprecated and will be removed in a future version. "
164
- "Use public APIs instead." ,
165
- DeprecationWarning ,
166
- # https://github.com/pandas-dev/pandas/pull/55139#pullrequestreview-1720690758
167
- # on hard-coding stacklevel
168
- stacklevel = 2 ,
169
- )
170
-
171
- if name == "create_block_manager_from_blocks" :
172
- from pandas .core .internals .managers import create_block_manager_from_blocks
173
-
174
- return create_block_manager_from_blocks
175
-
176
- elif name == "Block" :
177
- from pandas .core .internals .blocks import Block
178
-
179
- return Block
180
-
181
- elif name == "DatetimeTZBlock" :
182
- from pandas .core .internals .blocks import DatetimeTZBlock
183
-
184
- return DatetimeTZBlock
185
-
186
- elif name == "ExtensionBlock" :
187
- from pandas .core .internals .blocks import ExtensionBlock
188
-
189
- return ExtensionBlock
190
-
191
- raise AttributeError (
192
- f"module 'pandas.core.internals.api' has no attribute '{ name } '"
193
- )
0 commit comments