Skip to content

Commit c1d9071

Browse files
committed
wip
1 parent 3e5b664 commit c1d9071

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

pandas/core/algorithms.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,15 @@ def _reconstruct_data(
215215
# that values.dtype == dtype
216216
cls = dtype.construct_array_type()
217217

218-
# error: Incompatible types in assignment (expression has type
219-
# "ExtensionArray", variable has type "ndarray[Any, Any]")
220-
values = cls._from_sequence(values, dtype=dtype) # type: ignore[assignment]
221-
222-
else:
223-
values = values.astype(dtype, copy=False) # type: ignore[assignment]
224-
225-
return values
218+
# error: Incompatible return value type
219+
# (got "ExtensionArray",
220+
# expected "ndarray[tuple[Any, ...], dtype[Any]]")
221+
return cls._from_sequence(values, dtype=dtype) # type: ignore[return-value]
222+
223+
# error: Incompatible return value type
224+
# (got "ndarray[tuple[Any, ...], dtype[Any]]",
225+
# expected "ExtensionArray")
226+
return values.astype(dtype, copy=False) # type: ignore[return-value]
226227

227228

228229
def _ensure_arraylike(values, func_name: str) -> ArrayLike:

0 commit comments

Comments
 (0)