Skip to content

Commit 70adde1

Browse files
iasoonyehoshuadimarsky
authored andcommitted
TYP: resolve mypy ignores in core/groupby/ops.py (pandas-dev#47064)
1 parent ca32744 commit 70adde1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

pandas/core/groupby/ops.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -416,16 +416,14 @@ def _reconstruct_ea_result(
416416

417417
if isinstance(values.dtype, StringDtype):
418418
dtype = values.dtype
419-
cls = dtype.construct_array_type()
420-
return cls._from_sequence(res_values, dtype=dtype)
419+
string_array_cls = dtype.construct_array_type()
420+
return string_array_cls._from_sequence(res_values, dtype=dtype)
421421

422422
elif isinstance(values.dtype, BaseMaskedDtype):
423423
new_dtype = self._get_result_dtype(values.dtype.numpy_dtype)
424424
dtype = BaseMaskedDtype.from_numpy_dtype(new_dtype)
425-
# error: Incompatible types in assignment (expression has type
426-
# "Type[BaseMaskedArray]", variable has type "Type[BaseStringArray]")
427-
cls = dtype.construct_array_type() # type: ignore[assignment]
428-
return cls._from_sequence(res_values, dtype=dtype)
425+
masked_array_cls = dtype.construct_array_type()
426+
return masked_array_cls._from_sequence(res_values, dtype=dtype)
429427

430428
elif isinstance(values, (DatetimeArray, TimedeltaArray, PeriodArray)):
431429
# In to_cython_values we took a view as M8[ns]

0 commit comments

Comments
 (0)