Skip to content

STYLE: fix pylint redefined-outer-name warnings (#49656) #49662

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

Merged
merged 3 commits into from
Nov 13, 2022
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
4 changes: 2 additions & 2 deletions pandas/core/arrays/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@
)

from pandas.core import (
algorithms,
nanops,
ops,
)
from pandas.core.algorithms import (
checked_add_with_arr,
isin,
mode,
unique1d,
)
from pandas.core.arraylike import OpsMixin
Expand Down Expand Up @@ -1690,7 +1690,7 @@ def _mode(self, dropna: bool = True):
if dropna:
mask = self.isna()

i8modes = mode(self.view("i8"), mask=mask)
i8modes = algorithms.mode(self.view("i8"), mask=mask)
npmodes = i8modes.view(self._ndarray.dtype)
npmodes = cast(np.ndarray, npmodes)
return self._from_backing_data(npmodes)
Expand Down
11 changes: 3 additions & 8 deletions pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@
ops,
)
from pandas.core.accessor import DirNamesMixin
from pandas.core.algorithms import (
duplicated,
unique1d,
value_counts,
)
from pandas.core.arraylike import OpsMixin
from pandas.core.arrays import ExtensionArray
from pandas.core.construction import (
Expand Down Expand Up @@ -991,7 +986,7 @@ def value_counts(
NaN 1
dtype: int64
"""
return value_counts(
return algorithms.value_counts(
self,
sort=sort,
ascending=ascending,
Expand All @@ -1006,7 +1001,7 @@ def unique(self):
# i.e. ExtensionArray
result = values.unique()
else:
result = unique1d(values)
result = algorithms.unique1d(values)
return result

@final
Expand Down Expand Up @@ -1294,7 +1289,7 @@ def drop_duplicates(self, *, keep: DropKeep = "first"):

@final
def _duplicated(self, keep: DropKeep = "first") -> npt.NDArray[np.bool_]:
return duplicated(self._values, keep=keep)
return algorithms.duplicated(self._values, keep=keep)

def _arith_method(self, other, op):
res_name = ops.get_op_result_name(self, other)
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/computation/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ def maybe_expression(s) -> bool:
"""loose checking if s is a pytables-acceptable expression"""
if not isinstance(s, str):
return False
ops = PyTablesExprVisitor.binary_ops + PyTablesExprVisitor.unary_ops + ("=",)
operations = PyTablesExprVisitor.binary_ops + PyTablesExprVisitor.unary_ops + ("=",)

# make sure we have an op at least
return any(op in s for op in ops)
return any(op in s for op in operations)