Skip to content

Commit 4143dee

Browse files
grtcodergrtcoder
authored and
grtcoder
committed
STYLE: fix pylint redefined-outer-name warnings (pandas-dev#49656)
Fixed warnings for the following files :- - pandas/core/arrays/datetimelike.py - pandas/core/base.py - pandas/core/computation/pytables.py
1 parent 289f32d commit 4143dee

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

pandas/core/arrays/datetimelike.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
from pandas.core.algorithms import (
119119
checked_add_with_arr,
120120
isin,
121-
mode,
121+
mode as mode_func,
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 = mode_func(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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
)
6363
from pandas.core.accessor import DirNamesMixin
6464
from pandas.core.algorithms import (
65-
duplicated,
65+
duplicated as duplicated_func,
6666
unique1d,
6767
value_counts,
6868
)
@@ -1294,7 +1294,7 @@ def drop_duplicates(self, *, keep: DropKeep = "first"):
12941294

12951295
@final
12961296
def _duplicated(self, keep: DropKeep = "first") -> npt.NDArray[np.bool_]:
1297-
return duplicated(self._values, keep=keep)
1297+
return duplicated_func(self._values, keep=keep)
12981298

12991299
def _arith_method(self, other, op):
13001300
res_name = ops.get_op_result_name(self, other)

pandas/core/computation/pytables.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import pandas.core.common as com
2323
from pandas.core.computation import (
2424
expr,
25-
ops,
25+
ops as ops_func,
2626
scope as _scope,
2727
)
2828
from pandas.core.computation.common import ensure_decoded
@@ -56,7 +56,7 @@ def __init__(
5656
self.queryables = queryables or {}
5757

5858

59-
class Term(ops.Term):
59+
class Term(ops_func.Term):
6060
env: PyTablesScope
6161

6262
def __new__(cls, name, env, side=None, encoding=None):
@@ -98,7 +98,7 @@ def _resolve_name(self):
9898
return self._name
9999

100100

101-
class BinOp(ops.BinOp):
101+
class BinOp(ops_func.BinOp):
102102

103103
_max_selectors = 31
104104

@@ -386,7 +386,7 @@ def evaluate(self):
386386
return self
387387

388388

389-
class UnaryOp(ops.UnaryOp):
389+
class UnaryOp(ops_func.UnaryOp):
390390
def prune(self, klass):
391391

392392
if self.op != "~":

0 commit comments

Comments
 (0)