From afa76118f9762e99942cf9802e3795632c4293fb Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Sun, 30 Jun 2019 12:08:43 -0500 Subject: [PATCH] DEPR: remove pyarrow/fastparquet deprecations from #19265, #19434 --- pandas/core/internals/blocks.py | 23 +++-------------------- pandas/tests/internals/test_internals.py | 16 ---------------- 2 files changed, 3 insertions(+), 36 deletions(-) diff --git a/pandas/core/internals/blocks.py b/pandas/core/internals/blocks.py index f0128b70d7432..1f6ca4b3008b9 100644 --- a/pandas/core/internals/blocks.py +++ b/pandas/core/internals/blocks.py @@ -214,17 +214,12 @@ def make_block(self, values, placement=None, ndim=None): return make_block(values, placement=placement, ndim=ndim) - def make_block_same_class(self, values, placement=None, ndim=None, - dtype=None): + def make_block_same_class(self, values, placement=None, ndim=None): """ Wrap given values in a block of same type as self. """ - if dtype is not None: - # issue 19431 fastparquet is passing this - warnings.warn("dtype argument is deprecated, will be removed " - "in a future release.", FutureWarning) if placement is None: placement = self.mgr_locs return make_block(values, placement=placement, ndim=ndim, - klass=self.__class__, dtype=dtype) + klass=self.__class__) def __repr__(self): # don't want to print out all of the items here @@ -2246,13 +2241,6 @@ def is_view(self): # check the ndarray values of the DatetimeIndex values return self.values._data.base is not None - def copy(self, deep=True): - """ copy constructor """ - values = self.values - if deep: - values = values.copy() - return self.make_block_same_class(values) - def get_values(self, dtype=None): """ Returns an ndarray of values. @@ -3041,8 +3029,7 @@ def get_block_type(values, dtype=None): return cls -def make_block(values, placement, klass=None, ndim=None, dtype=None, - fastpath=None): +def make_block(values, placement, klass=None, ndim=None, dtype=None): # Ensure that we don't allow PandasArray / PandasDtype in internals. # For now, blocks should be backed by ndarrays when possible. if isinstance(values, ABCPandasArray): @@ -3053,10 +3040,6 @@ def make_block(values, placement, klass=None, ndim=None, dtype=None, if isinstance(dtype, PandasDtype): dtype = dtype.numpy_dtype - if fastpath is not None: - # GH#19265 pyarrow is passing this - warnings.warn("fastpath argument is deprecated, will be removed " - "in a future release.", FutureWarning) if klass is None: dtype = dtype or values.dtype klass = get_block_type(values, dtype) diff --git a/pandas/tests/internals/test_internals.py b/pandas/tests/internals/test_internals.py index 697c0b5280589..b4631b67408a5 100644 --- a/pandas/tests/internals/test_internals.py +++ b/pandas/tests/internals/test_internals.py @@ -284,14 +284,6 @@ def test_delete(self): with pytest.raises(Exception): newb.delete(3) - def test_make_block_same_class(self): - # issue 19431 - block = create_block('M8[ns, US/Eastern]', [3]) - with tm.assert_produces_warning(FutureWarning, - check_stacklevel=False): - block.make_block_same_class(block.values, - dtype=block.values.dtype) - class TestDatetimeBlock: @@ -1251,14 +1243,6 @@ def test_holder(typestr, holder): assert blk._holder is holder -def test_deprecated_fastpath(): - # GH#19265 - values = np.random.rand(3, 3) - with tm.assert_produces_warning(FutureWarning, - check_stacklevel=False): - make_block(values, placement=np.arange(3), fastpath=True) - - def test_validate_ndim(): values = np.array([1.0, 2.0]) placement = slice(2)