Skip to content

Commit

Permalink
Speed up NestedExtensionArray.copy
Browse files Browse the repository at this point in the history
  • Loading branch information
hombit committed Oct 30, 2024
1 parent b8707a9 commit a3ce966
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nested_pandas/series/ext_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def __setitem__(self, key, value) -> None:
# Copy will happen later in replace_with_mask() anyway
value = self._box_pa_array(value, pa_type=self._pyarrow_dtype)
else:
# Our replace_with_mask implementation doesm't work with scalars
# Our replace_with_mask implementation doesn't work with scalars
value = pa.array([scalar] * pa.compute.sum(pa_mask).as_py())

if argsort is not None:
Expand Down Expand Up @@ -387,7 +387,7 @@ def copy(self) -> Self: # type: ignore[name-defined] # noqa: F821
This implementation returns a shallow copy of the extension array,
because the underlying PyArrow array is immutable.
"""
return type(self)(self._chunked_array)
return type(self)(self._chunked_array, validate=False)

def _formatter(self, boxed: bool = False) -> Callable[[Any], str | None]:
# TODO: make formatted strings more pretty
Expand Down

0 comments on commit a3ce966

Please sign in to comment.