Skip to content

Commit e7b044c

Browse files
authored
STYLE: fix pylint redefined-outer-name warnings (#49656) (#49662)
* STYLE: fix pylint redefined-outer-name warnings (#49656) Fixed warnings for the following files :- - pandas/core/arrays/datetimelike.py - pandas/core/base.py - pandas/core/computation/pytables.py * STYLE: fix pylint redefined-outer-name warnings (#49656) Fixed warnings for the following files :- - pandas/core/arrays/datetimelike.py - pandas/core/base.py - pandas/core/computation/pytables.py Iteration :- 2
1 parent 2f7b42d commit e7b044c

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

pandas/core/arrays/datetimelike.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@
112112
)
113113

114114
from pandas.core import (
115+
algorithms,
115116
nanops,
116117
ops,
117118
)
118119
from pandas.core.algorithms import (
119120
checked_add_with_arr,
120121
isin,
121-
mode,
122122
unique1d,
123123
)
124124
from pandas.core.arraylike import OpsMixin
@@ -1690,7 +1690,7 @@ def _mode(self, dropna: bool = True):
16901690
if dropna:
16911691
mask = self.isna()
16921692

1693-
i8modes = mode(self.view("i8"), mask=mask)
1693+
i8modes = algorithms.mode(self.view("i8"), mask=mask)
16941694
npmodes = i8modes.view(self._ndarray.dtype)
16951695
npmodes = cast(np.ndarray, npmodes)
16961696
return self._from_backing_data(npmodes)

pandas/core/base.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@
6161
ops,
6262
)
6363
from pandas.core.accessor import DirNamesMixin
64-
from pandas.core.algorithms import (
65-
duplicated,
66-
unique1d,
67-
value_counts,
68-
)
6964
from pandas.core.arraylike import OpsMixin
7065
from pandas.core.arrays import ExtensionArray
7166
from pandas.core.construction import (
@@ -991,7 +986,7 @@ def value_counts(
991986
NaN 1
992987
dtype: int64
993988
"""
994-
return value_counts(
989+
return algorithms.value_counts(
995990
self,
996991
sort=sort,
997992
ascending=ascending,
@@ -1006,7 +1001,7 @@ def unique(self):
10061001
# i.e. ExtensionArray
10071002
result = values.unique()
10081003
else:
1009-
result = unique1d(values)
1004+
result = algorithms.unique1d(values)
10101005
return result
10111006

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

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

12991294
def _arith_method(self, other, op):
13001295
res_name = ops.get_op_result_name(self, other)

pandas/core/computation/pytables.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ def maybe_expression(s) -> bool:
650650
"""loose checking if s is a pytables-acceptable expression"""
651651
if not isinstance(s, str):
652652
return False
653-
ops = PyTablesExprVisitor.binary_ops + PyTablesExprVisitor.unary_ops + ("=",)
653+
operations = PyTablesExprVisitor.binary_ops + PyTablesExprVisitor.unary_ops + ("=",)
654654

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

0 commit comments

Comments
 (0)