Skip to content

Commit 304351e

Browse files
upgrade mypy-0.720 typed-ast-1.4.0
1 parent dd95741 commit 304351e

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

pandas/core/arrays/base.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1164,10 +1164,9 @@ def _maybe_convert(arr):
11641164

11651165
if op.__name__ in {"divmod", "rdivmod"}:
11661166
a, b = zip(*res)
1167-
res = _maybe_convert(a), _maybe_convert(b)
1168-
else:
1169-
res = _maybe_convert(res)
1170-
return res
1167+
return _maybe_convert(a), _maybe_convert(b)
1168+
1169+
return _maybe_convert(res)
11711170

11721171
op_name = ops._get_op_name(op, True)
11731172
return set_function_name(_binop, op_name, cls)

pandas/core/indexes/base.py

+1
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ def __new__(
458458
return Index(np.asarray(data), dtype=dtype, copy=copy, name=name, **kwargs)
459459
elif data is None or is_scalar(data):
460460
cls._scalar_data_error(data)
461+
return None
461462
else:
462463
if tupleize_cols and is_list_like(data):
463464
# GH21470: convert iterable to list before determining if empty

pandas/core/ops/__init__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,10 @@ def wrapper(self, other):
858858

859859
# For int vs int `^`, `|`, `&` are bitwise operators and return
860860
# integer dtypes. Otherwise these are boolean ops
861-
filler = fill_int if is_self_int_dtype and is_other_int_dtype else fill_bool
861+
if is_self_int_dtype and is_other_int_dtype:
862+
filler = fill_int
863+
else:
864+
filler = fill_bool
862865
res_values = na_op(self.values, ovalues)
863866
unfilled = self._constructor(res_values, index=self.index, name=res_name)
864867
filled = filler(unfilled)

pandas/core/util/hashing.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
data hash pandas / numpy objects
33
"""
44
import itertools
5+
from typing import Iterator
56

67
# error: No library stub file for module 'numpy'
78
import numpy as np # type: ignore
@@ -113,7 +114,7 @@ def hash_pandas_object(
113114
h = Series(h, index=obj.index, dtype="uint64", copy=False)
114115

115116
elif isinstance(obj, ABCDataFrame):
116-
hashes = (hash_array(series.values) for _, series in obj.items())
117+
hashes: Iterator = (hash_array(series.values) for _, series in obj.items())
117118
num_items = len(obj.columns)
118119
if index:
119120
index_hash_generator = (
@@ -123,7 +124,7 @@ def hash_pandas_object(
123124
encoding=encoding,
124125
hash_key=hash_key,
125126
categorize=categorize,
126-
).values # noqa
127+
).values
127128
for _ in [None]
128129
)
129130
num_items += 1

0 commit comments

Comments
 (0)