Skip to content

Commit 0ccb0ef

Browse files
authored
CI: fix mypy complaints (#45191)
1 parent a6c1f6c commit 0ccb0ef

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

pandas/core/ops/array_ops.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
import datetime
66
from functools import partial
77
import operator
8-
from typing import (
9-
Any,
10-
cast,
11-
)
8+
from typing import Any
129

1310
import numpy as np
1411

@@ -94,8 +91,6 @@ def _masked_arith_op(x: np.ndarray, y, op):
9491
assert isinstance(x, np.ndarray), type(x)
9592
if isinstance(y, np.ndarray):
9693
dtype = find_common_type([x.dtype, y.dtype])
97-
# x and y are both ndarrays -> common_dtype is np.dtype
98-
dtype = cast(np.dtype, dtype)
9994
result = np.empty(x.size, dtype=dtype)
10095

10196
if len(x) != len(y):

pandas/io/stata.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1698,13 +1698,13 @@ def read(
16981698
data = DataFrame(columns=self.varlist)
16991699
else:
17001700
data = DataFrame.from_records(raw_data)
1701-
data.columns = self.varlist
1701+
data.columns = Index(self.varlist)
17021702

17031703
# If index is not specified, use actual row number rather than
17041704
# restarting at 0 for each chunk.
17051705
if index_col is None:
1706-
ix = np.arange(self._lines_read - read_lines, self._lines_read)
1707-
data.index = ix # set attr instead of set_index to avoid copy
1706+
rng = np.arange(self._lines_read - read_lines, self._lines_read)
1707+
data.index = Index(rng) # set attr instead of set_index to avoid copy
17081708

17091709
if columns is not None:
17101710
try:

0 commit comments

Comments
 (0)