Skip to content

Commit 258e55e

Browse files
authored
FIX: Ignore typing and numba warnings in 2.0.x (pandas-dev#53372)
1 parent c8cd027 commit 258e55e

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

doc/source/user_guide/window.rst

+2
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ For example, a `weighted mean <https://en.wikipedia.org/wiki/Weighted_arithmetic
8989
be calculated with :meth:`~Rolling.apply` by specifying a separate column of weights.
9090

9191
.. ipython:: python
92+
:okwarning:
9293
9394
def weighted_mean(x):
9495
arr = np.ones((1, x.shape[1]))
@@ -114,6 +115,7 @@ the ``update`` argument to continue the windowing calculation.
114115
df.ewm(0.5).mean()
115116
116117
.. ipython:: python
118+
:okwarning:
117119
118120
online_ewm = df.head(2).ewm(0.5).online()
119121
online_ewm.mean()

doc/source/whatsnew/v2.0.2.rst

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Bug fixes
3939
- Bug in :meth:`pd.array` raising for ``NumPy`` array and ``pa.large_string`` or ``pa.large_binary`` (:issue:`52590`)
4040
- Bug in :meth:`DataFrame.__getitem__` not preserving dtypes for :class:`MultiIndex` partial keys (:issue:`51895`)
4141
-
42+
4243
.. ---------------------------------------------------------------------------
4344
.. _whatsnew_202.other:
4445

pandas/core/_numba/kernels/mean_.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def sliding_mean(
100100
neg_ct,
101101
compensation_add,
102102
num_consecutive_same_value,
103-
prev_value,
103+
prev_value, # pyright: ignore[reportGeneralTypeIssues]
104104
)
105105
else:
106106
for j in range(start[i - 1], s):
@@ -125,7 +125,7 @@ def sliding_mean(
125125
neg_ct,
126126
compensation_add,
127127
num_consecutive_same_value,
128-
prev_value,
128+
prev_value, # pyright: ignore[reportGeneralTypeIssues]
129129
)
130130

131131
if nobs >= min_periods and nobs > 0:

pandas/core/_numba/kernels/sum_.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def sliding_sum(
9292
sum_x,
9393
compensation_add,
9494
num_consecutive_same_value,
95-
prev_value,
95+
prev_value, # pyright: ignore[reportGeneralTypeIssues]
9696
)
9797
else:
9898
for j in range(start[i - 1], s):
@@ -115,7 +115,7 @@ def sliding_sum(
115115
sum_x,
116116
compensation_add,
117117
num_consecutive_same_value,
118-
prev_value,
118+
prev_value, # pyright: ignore[reportGeneralTypeIssues]
119119
)
120120

121121
if nobs == 0 == min_periods:

pandas/core/_numba/kernels/var_.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def sliding_var(
110110
ssqdm_x,
111111
compensation_add,
112112
num_consecutive_same_value,
113-
prev_value,
113+
prev_value, # pyright: ignore[reportGeneralTypeIssues]
114114
)
115115
else:
116116
for j in range(start[i - 1], s):
@@ -135,7 +135,7 @@ def sliding_var(
135135
ssqdm_x,
136136
compensation_add,
137137
num_consecutive_same_value,
138-
prev_value,
138+
prev_value, # pyright: ignore[reportGeneralTypeIssues]
139139
)
140140

141141
if nobs >= min_periods and nobs > ddof:

pandas/core/groupby/groupby.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3074,12 +3074,12 @@ def _nth(
30743074
# error: No overload variant of "where" matches argument types
30753075
# "Any", "NAType", "Any"
30763076
values = np.where(nulls, NA, grouper) # type: ignore[call-overload]
3077-
grouper = Index(values, dtype="Int64")
3077+
grouper = Index(values, dtype="Int64") # type: ignore[assignment]
30783078

30793079
else:
30803080
# create a grouper with the original parameters, but on dropped
30813081
# object
3082-
grouper, _, _ = get_grouper(
3082+
grouper, _, _ = get_grouper( # type: ignore[assignment]
30833083
dropped,
30843084
key=self.keys,
30853085
axis=self.axis,

0 commit comments

Comments
 (0)