Skip to content

CLN: remove fastparquet compat shim #27170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions pandas/core/internals/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,19 +254,11 @@ def make_block(self, values, placement=None):

return make_block(values, placement=placement, ndim=self.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
)
return make_block(values, placement=placement, ndim=ndim, klass=self.__class__)

def __repr__(self):
# don't want to print out all of the items here
Expand Down Expand Up @@ -3275,7 +3267,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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you can type things would be great (new PR)

# Ensure that we don't allow PandasArray / PandasDtype in internals.
# For now, blocks should be backed by ndarrays when possible.
if isinstance(values, ABCPandasArray):
Expand All @@ -3286,12 +3278,6 @@ def make_block(values, placement, klass=None, ndim=None, dtype=None, fastpath=No
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)
Expand Down
13 changes: 0 additions & 13 deletions pandas/tests/internals/test_internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,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:
def test_try_coerce_arg(self):
Expand Down Expand Up @@ -1311,13 +1305,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)
Expand Down