Skip to content

Commit df51168

Browse files
committed
Added ignore where mypy thinks self.subplots is a bool
1 parent ddd3311 commit df51168

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

pandas/plotting/_matplotlib/core.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,18 +1929,16 @@ def _make_plot(self, fig: Figure) -> None:
19291929

19301930
data = self.data.fillna(0)
19311931

1932-
_stacked_subplots_ind = {}
1932+
_stacked_subplots_ind: dict[int, int] = {}
19331933
_stacked_subplots_offsets = []
19341934

1935-
if self.subplots:
1936-
subplots_status = 1
1937-
else:
1938-
subplots_status = 0
1939-
1940-
if subplots_status & self.stacked:
1941-
sub_range = range(len(self.subplots))
1935+
if self.subplots != False & self.stacked:
1936+
sub_range = range(len(self.subplots)) # type:ignore[arg-type]
19421937
ss_temp = {
1943-
x: self.subplots[x] for x in sub_range if len(self.subplots[x]) > 1
1938+
# mypy thinks self.subplots is a bool :(
1939+
x: self.subplots[x] # type:ignore[index]
1940+
for x in sub_range
1941+
if len(self.subplots[x]) > 1 # type:ignore[index]
19441942
}
19451943
for k, v in ss_temp.items():
19461944
for x in v:
@@ -1976,7 +1974,7 @@ def _make_plot(self, fig: Figure) -> None:
19761974

19771975
if i in _stacked_subplots_ind:
19781976
offset_index = _stacked_subplots_ind[i]
1979-
pos_prior, neg_prior = _stacked_subplots_offsets[offset_index]
1977+
pos_prior, neg_prior = _stacked_subplots_offsets[offset_index] # type:ignore[assignment]
19801978
mask = y >= 0
19811979
start = np.where(mask, pos_prior, neg_prior) + self._start_base
19821980
w = self.bar_width / 2

0 commit comments

Comments
 (0)