Skip to content

Commit afa7611

Browse files
committed
DEPR: remove pyarrow/fastparquet deprecations from pandas-dev#19265, pandas-dev#19434
1 parent b491329 commit afa7611

File tree

2 files changed

+3
-36
lines changed

2 files changed

+3
-36
lines changed

pandas/core/internals/blocks.py

+3-20
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,12 @@ def make_block(self, values, placement=None, ndim=None):
214214

215215
return make_block(values, placement=placement, ndim=ndim)
216216

217-
def make_block_same_class(self, values, placement=None, ndim=None,
218-
dtype=None):
217+
def make_block_same_class(self, values, placement=None, ndim=None):
219218
""" Wrap given values in a block of same type as self. """
220-
if dtype is not None:
221-
# issue 19431 fastparquet is passing this
222-
warnings.warn("dtype argument is deprecated, will be removed "
223-
"in a future release.", FutureWarning)
224219
if placement is None:
225220
placement = self.mgr_locs
226221
return make_block(values, placement=placement, ndim=ndim,
227-
klass=self.__class__, dtype=dtype)
222+
klass=self.__class__)
228223

229224
def __repr__(self):
230225
# don't want to print out all of the items here
@@ -2246,13 +2241,6 @@ def is_view(self):
22462241
# check the ndarray values of the DatetimeIndex values
22472242
return self.values._data.base is not None
22482243

2249-
def copy(self, deep=True):
2250-
""" copy constructor """
2251-
values = self.values
2252-
if deep:
2253-
values = values.copy()
2254-
return self.make_block_same_class(values)
2255-
22562244
def get_values(self, dtype=None):
22572245
"""
22582246
Returns an ndarray of values.
@@ -3041,8 +3029,7 @@ def get_block_type(values, dtype=None):
30413029
return cls
30423030

30433031

3044-
def make_block(values, placement, klass=None, ndim=None, dtype=None,
3045-
fastpath=None):
3032+
def make_block(values, placement, klass=None, ndim=None, dtype=None):
30463033
# Ensure that we don't allow PandasArray / PandasDtype in internals.
30473034
# For now, blocks should be backed by ndarrays when possible.
30483035
if isinstance(values, ABCPandasArray):
@@ -3053,10 +3040,6 @@ def make_block(values, placement, klass=None, ndim=None, dtype=None,
30533040
if isinstance(dtype, PandasDtype):
30543041
dtype = dtype.numpy_dtype
30553042

3056-
if fastpath is not None:
3057-
# GH#19265 pyarrow is passing this
3058-
warnings.warn("fastpath argument is deprecated, will be removed "
3059-
"in a future release.", FutureWarning)
30603043
if klass is None:
30613044
dtype = dtype or values.dtype
30623045
klass = get_block_type(values, dtype)

pandas/tests/internals/test_internals.py

-16
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,6 @@ def test_delete(self):
284284
with pytest.raises(Exception):
285285
newb.delete(3)
286286

287-
def test_make_block_same_class(self):
288-
# issue 19431
289-
block = create_block('M8[ns, US/Eastern]', [3])
290-
with tm.assert_produces_warning(FutureWarning,
291-
check_stacklevel=False):
292-
block.make_block_same_class(block.values,
293-
dtype=block.values.dtype)
294-
295287

296288
class TestDatetimeBlock:
297289

@@ -1251,14 +1243,6 @@ def test_holder(typestr, holder):
12511243
assert blk._holder is holder
12521244

12531245

1254-
def test_deprecated_fastpath():
1255-
# GH#19265
1256-
values = np.random.rand(3, 3)
1257-
with tm.assert_produces_warning(FutureWarning,
1258-
check_stacklevel=False):
1259-
make_block(values, placement=np.arange(3), fastpath=True)
1260-
1261-
12621246
def test_validate_ndim():
12631247
values = np.array([1.0, 2.0])
12641248
placement = slice(2)

0 commit comments

Comments
 (0)