Skip to content

Commit cfd51c1

Browse files
committed
remove unreachable code, type data and return
1 parent d5e8edc commit cfd51c1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pandas/plotting/_matplotlib/timeseries.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# TODO: Use the fact that axis can have units to simplify the process
22

33
import functools
4-
from typing import Optional
4+
from typing import TYPE_CHECKING, Optional
55

66
import numpy as np
77

@@ -24,6 +24,10 @@
2424
from pandas.tseries.frequencies import is_subperiod, is_superperiod
2525
from pandas.tseries.offsets import DateOffset
2626

27+
if TYPE_CHECKING:
28+
from pandas._typing import FrameOrSeries # noqa: F401
29+
30+
2731
# ---------------------------------------------------------------------
2832
# Plotting functions and monkey patches
2933

@@ -188,7 +192,8 @@ def _get_freq(ax, series):
188192
return freq, ax_freq
189193

190194

191-
def _use_dynamic_x(ax, data):
195+
def _use_dynamic_x(ax, data: "FrameOrSeries") -> bool:
196+
192197
freq = _get_index_freq(data)
193198
ax_freq = _get_ax_freq(ax)
194199

@@ -203,9 +208,6 @@ def _use_dynamic_x(ax, data):
203208

204209
freq = get_period_alias(freq)
205210

206-
if freq is None:
207-
return False
208-
209211
# FIXME: hack this for 0.10.1, creating more technical debt...sigh
210212
if isinstance(data.index, ABCDatetimeIndex):
211213
base = get_freq_code(freq)[0]

0 commit comments

Comments
 (0)