Skip to content
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

Speed up NestedExtensionArray.copy #164

Merged
merged 1 commit into from
Oct 31, 2024
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
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