Skip to content

CoW: Remove some no longer necessary todos #56525

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 1 commit into from
Dec 18, 2023
Merged
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
5 changes: 0 additions & 5 deletions pandas/core/internals/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1178,8 +1178,6 @@ def value_getitem(placement):
unfit_count = len(unfit_idxr)

new_blocks: list[Block] = []
# TODO(CoW) is this always correct to assume that the new_blocks
# are not referencing anything else?
if value_is_extension_type:
# This code (ab-)uses the fact that EA blocks contain only
# one item.
Expand Down Expand Up @@ -1377,7 +1375,6 @@ def insert(self, loc: int, item: Hashable, value: ArrayLike, refs=None) -> None:
value = ensure_block_shape(value, ndim=self.ndim)

bp = BlockPlacement(slice(loc, loc + 1))
# TODO(CoW) do we always "own" the passed `value`?
block = new_block_2d(values=value, placement=bp, refs=refs)

if not len(self.blocks):
Expand Down Expand Up @@ -1660,7 +1657,6 @@ def as_array(
"""
passed_nan = lib.is_float(na_value) and isna(na_value)

# TODO(CoW) handle case where resulting array is a view
if len(self.blocks) == 0:
arr = np.empty(self.shape, dtype=float)
return arr.transpose()
Expand Down Expand Up @@ -2198,7 +2194,6 @@ def _form_blocks(arrays: list[ArrayLike], consolidate: bool, refs: list) -> list

# when consolidating, we can ignore refs (either stacking always copies,
# or the EA is already copied in the calling dict_to_mgr)
# TODO(CoW) check if this is also valid for rec_array_to_mgr

# group by dtype
grouper = itertools.groupby(tuples, _grouping_func)
Expand Down