Skip to content

CLN: unnecessary usages of Block.get_values #32707

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

Merged
merged 3 commits into from
Mar 14, 2020
Merged
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
6 changes: 4 additions & 2 deletions pandas/core/internals/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,9 @@ def astype(self, dtype, copy: bool = False, errors: str = "raise"):

# astype formatting
else:
values = self.get_values()
# Because we have neither is_extension nor is_datelike,
# self.values already has the correct shape
values = self.values

else:
values = self.get_values(dtype=dtype)
Expand Down Expand Up @@ -663,7 +665,7 @@ def _can_hold_element(self, element: Any) -> bool:

def to_native_types(self, slicer=None, na_rep="nan", quoting=None, **kwargs):
""" convert to our native types format, slicing if desired """
values = self.get_values()
values = self.values

if slicer is not None:
values = values[:, slicer]
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/internals/concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def get_reindexed_values(self, empty_dtype, upcasted_na):
else:
# No dtype upcasting is done here, it will be performed during
# concatenation itself.
values = self.block.get_values()
values = self.block.values

if not self.indexers:
# If there's no indexing to be done, we want to signal outside
Expand Down