@@ -588,17 +588,9 @@ def nansum(
588
588
dtype_sum = np .float64 # type: ignore[assignment]
589
589
590
590
the_sum = values .sum (axis , dtype = dtype_sum )
591
- # error: Incompatible types in assignment (expression has type "float", variable has
592
- # type "Union[number, ndarray]")
593
- # error: Argument 1 to "_maybe_null_out" has incompatible type "Union[number,
594
- # ndarray]"; expected "ndarray"
595
- the_sum = _maybe_null_out ( # type: ignore[assignment]
596
- the_sum , axis , mask , values .shape , min_count = min_count # type: ignore[arg-type]
597
- )
591
+ the_sum = _maybe_null_out (the_sum , axis , mask , values .shape , min_count = min_count )
598
592
599
- # error: Incompatible return value type (got "Union[number, ndarray]", expected
600
- # "float")
601
- return the_sum # type: ignore[return-value]
593
+ return the_sum
602
594
603
595
604
596
def _mask_datetimelike_result (
@@ -1343,12 +1335,10 @@ def nanprod(
1343
1335
values = values .copy ()
1344
1336
values [mask ] = 1
1345
1337
result = values .prod (axis )
1346
- # error: Argument 1 to "_maybe_null_out" has incompatible type "Union[number,
1347
- # ndarray]"; expected "ndarray"
1348
1338
# error: Incompatible return value type (got "Union[ndarray, float]", expected
1349
1339
# "float")
1350
1340
return _maybe_null_out ( # type: ignore[return-value]
1351
- result , axis , mask , values .shape , min_count = min_count # type: ignore[arg-type]
1341
+ result , axis , mask , values .shape , min_count = min_count
1352
1342
)
1353
1343
1354
1344
@@ -1424,13 +1414,7 @@ def _get_counts(
1424
1414
# expected "Union[int, float, ndarray]")
1425
1415
return dtype .type (count ) # type: ignore[return-value]
1426
1416
try :
1427
- # error: Incompatible return value type (got "Union[ndarray, generic]", expected
1428
- # "Union[int, float, ndarray]")
1429
- # error: Argument 1 to "astype" of "_ArrayOrScalarCommon" has incompatible type
1430
- # "Union[ExtensionDtype, dtype]"; expected "Union[dtype, None, type,
1431
- # _SupportsDtype, str, Tuple[Any, int], Tuple[Any, Union[int, Sequence[int]]],
1432
- # List[Any], _DtypeDict, Tuple[Any, Any]]"
1433
- return count .astype (dtype ) # type: ignore[return-value,arg-type]
1417
+ return count .astype (dtype )
1434
1418
except AttributeError :
1435
1419
# error: Argument "dtype" to "array" has incompatible type
1436
1420
# "Union[ExtensionDtype, dtype]"; expected "Union[dtype, None, type,
0 commit comments