Skip to content

Commit 607b95e

Browse files
fix typing
1 parent 0eee625 commit 607b95e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pandas/_testing/asserters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,11 +808,11 @@ def assert_extension_array_equal(
808808
# Specifically for StringArrayNumpySemantics, validate here we have a valid array
809809
if isinstance(left.dtype, StringDtype) and left.dtype.storage == "python_numpy":
810810
assert np.all(
811-
[np.isnan(val) for val in left._ndarray[left_na]]
811+
[np.isnan(val) for val in left._ndarray[left_na]] # type: ignore[attr-defined]
812812
), "wrong missing value sentinels"
813813
if isinstance(right.dtype, StringDtype) and right.dtype.storage == "python_numpy":
814814
assert np.all(
815-
[np.isnan(val) for val in right._ndarray[right_na]]
815+
[np.isnan(val) for val in right._ndarray[right_na]] # type: ignore[attr-defined]
816816
), "wrong missing value sentinels"
817817

818818
left_valid = left[~left_na].to_numpy(dtype=object)

pandas/core/arrays/string_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ def _from_sequence(
718718
dtype = StringDtype(storage="python_numpy")
719719
return super()._from_sequence(scalars, dtype=dtype, copy=copy)
720720

721-
def _from_backing_data(self, arr: np.ndarray) -> NumpyExtensionArray:
721+
def _from_backing_data(self, arr: np.ndarray) -> StringArrayNumpySemantics:
722722
# need to overrde NumpyExtensionArray._from_backing_data to ensure
723723
# we always preserve the dtype
724724
return NDArrayBacked._from_backing_data(self, arr)

0 commit comments

Comments
 (0)