Skip to content

Commit 5e6372e

Browse files
committed
silence errors II
1 parent c990a0d commit 5e6372e

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

pandas/core/arrays/masked.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,9 @@ def _wrap_na_result(self, *, name, axis):
11151115
if name in ["mean", "median", "var", "std", "skew"]:
11161116
np_dtype = float_dtype
11171117
elif name in ["min", "max"]:
1118-
np_dtype = self.dtype.type
1118+
# Incompatible types in assignment (expression has type "str", variable has
1119+
# type "Union[dtype[Any], ExtensionDtype]")
1120+
np_dtype = self.dtype.type # type: ignore[assignment]
11191121
else:
11201122
np_dtype = {"i": "int64", "u": "uint64", "f": float_dtype}[self.dtype.kind]
11211123

pandas/tests/extension/masked_shared.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def check_reduce_with_wrap(self, ser: pd.Series, op_name: str, skipna: bool):
7070

7171
arr = ser.array
7272

73-
float32_cond = arr.dtype == "Float32" and not is_platform_windows()
73+
float32_cond = arr.dtype == "Float32" and is_platform_windows() or not IS64
7474
float_dtype = "Float32" if float32_cond else "Float64"
7575

7676
if op_name in ["mean", "median", "var", "std", "skew"]:

pandas/tests/extension/test_arrow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
from pandas.core.dtypes.dtypes import CategoricalDtypeType
4444

45+
from pandas._typing import Dtype
4546
import pandas as pd
4647
import pandas._testing as tm
4748
from pandas.api.types import (
@@ -58,7 +59,6 @@
5859
pa = pytest.importorskip("pyarrow", minversion="7.0.0")
5960

6061
from pandas.core.arrays.arrow.array import ArrowExtensionArray
61-
6262
from pandas.core.arrays.arrow.dtype import ArrowDtype # isort:skip
6363

6464

@@ -513,10 +513,10 @@ def check_reduce_with_wrap(self, ser: pd.Series, op_name: str, skipna: bool):
513513
kwargs = {"ddof": 1} if op_name in ["var", "std"] else {}
514514

515515
if op_name in ["max", "min"]:
516-
cmp_dtype = arr.dtype.name
516+
cmp_dtype: Dtype = arr.dtype
517517
elif arr.dtype.name == "decimal128(7, 3)[pyarrow]":
518518
if op_name not in ["median", "var", "std"]:
519-
cmp_dtype = arr.dtype.name
519+
cmp_dtype = arr.dtype
520520
else:
521521
cmp_dtype = "float64[pyarrow]"
522522
elif op_name in ["median", "var", "std", "mean", "skew"]:

0 commit comments

Comments
 (0)