Skip to content

Commit f4f9969

Browse files
Moisanphofl
authored andcommitted
STYLE: fix pylint consider-using-min-builtin warnings (pandas-dev#49564)
1 parent 33aacd8 commit f4f9969

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

pandas/io/sas/sas7bdat.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -668,9 +668,7 @@ def read(self, nrows: int | None = None) -> DataFrame:
668668
if nrows > 0 and self._current_row_in_file_index >= self.row_count:
669669
return DataFrame()
670670

671-
m = self.row_count - self._current_row_in_file_index
672-
if nrows > m:
673-
nrows = m
671+
nrows = min(nrows, self.row_count - self._current_row_in_file_index)
674672

675673
nd = self._column_types.count(b"d")
676674
ns = self._column_types.count(b"s")

pandas/plotting/_matplotlib/converter.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,5 @@ def format_timedelta_ticks(x, pos, n_decimals: int) -> str:
11091109

11101110
def __call__(self, x, pos: int = 0) -> str:
11111111
(vmin, vmax) = tuple(self.axis.get_view_interval())
1112-
n_decimals = int(np.ceil(np.log10(100 * 10**9 / abs(vmax - vmin))))
1113-
if n_decimals > 9:
1114-
n_decimals = 9
1112+
n_decimals = min(int(np.ceil(np.log10(100 * 10**9 / abs(vmax - vmin)))), 9)
11151113
return self.format_timedelta_ticks(x, pos, n_decimals)

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ disable = [
103103
"chained-comparison",
104104
"comparison-with-itself",
105105
"consider-merging-isinstance",
106-
"consider-using-min-builtin",
107106
"consider-using-ternary",
108107
"consider-using-with",
109108
"cyclic-import",

0 commit comments

Comments
 (0)