Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Ignore typing and numba warnings in 2.0.x #53372

Merged
merged 1 commit into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/source/user_guide/window.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ For example, a `weighted mean <https://en.wikipedia.org/wiki/Weighted_arithmetic
be calculated with :meth:`~Rolling.apply` by specifying a separate column of weights.

.. ipython:: python
:okwarning:

def weighted_mean(x):
arr = np.ones((1, x.shape[1]))
Expand All @@ -114,6 +115,7 @@ the ``update`` argument to continue the windowing calculation.
df.ewm(0.5).mean()

.. ipython:: python
:okwarning:

online_ewm = df.head(2).ewm(0.5).online()
online_ewm.mean()
Expand Down
1 change: 1 addition & 0 deletions doc/source/whatsnew/v2.0.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Bug fixes
- Bug in :meth:`pd.array` raising for ``NumPy`` array and ``pa.large_string`` or ``pa.large_binary`` (:issue:`52590`)
- Bug in :meth:`DataFrame.__getitem__` not preserving dtypes for :class:`MultiIndex` partial keys (:issue:`51895`)
-

.. ---------------------------------------------------------------------------
.. _whatsnew_202.other:

Expand Down
4 changes: 2 additions & 2 deletions pandas/core/_numba/kernels/mean_.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def sliding_mean(
neg_ct,
compensation_add,
num_consecutive_same_value,
prev_value,
prev_value, # pyright: ignore[reportGeneralTypeIssues]
)
else:
for j in range(start[i - 1], s):
Expand All @@ -125,7 +125,7 @@ def sliding_mean(
neg_ct,
compensation_add,
num_consecutive_same_value,
prev_value,
prev_value, # pyright: ignore[reportGeneralTypeIssues]
)

if nobs >= min_periods and nobs > 0:
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/_numba/kernels/sum_.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def sliding_sum(
sum_x,
compensation_add,
num_consecutive_same_value,
prev_value,
prev_value, # pyright: ignore[reportGeneralTypeIssues]
)
else:
for j in range(start[i - 1], s):
Expand All @@ -115,7 +115,7 @@ def sliding_sum(
sum_x,
compensation_add,
num_consecutive_same_value,
prev_value,
prev_value, # pyright: ignore[reportGeneralTypeIssues]
)

if nobs == 0 == min_periods:
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/_numba/kernels/var_.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def sliding_var(
ssqdm_x,
compensation_add,
num_consecutive_same_value,
prev_value,
prev_value, # pyright: ignore[reportGeneralTypeIssues]
)
else:
for j in range(start[i - 1], s):
Expand All @@ -135,7 +135,7 @@ def sliding_var(
ssqdm_x,
compensation_add,
num_consecutive_same_value,
prev_value,
prev_value, # pyright: ignore[reportGeneralTypeIssues]
)

if nobs >= min_periods and nobs > ddof:
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -3074,12 +3074,12 @@ def _nth(
# error: No overload variant of "where" matches argument types
# "Any", "NAType", "Any"
values = np.where(nulls, NA, grouper) # type: ignore[call-overload]
grouper = Index(values, dtype="Int64")
grouper = Index(values, dtype="Int64") # type: ignore[assignment]

else:
# create a grouper with the original parameters, but on dropped
# object
grouper, _, _ = get_grouper(
grouper, _, _ = get_grouper( # type: ignore[assignment]
dropped,
key=self.keys,
axis=self.axis,
Expand Down