Skip to content

Commit 6e2d3ae

Browse files
committed
revert to tz_localize, as tz_convert didn't help the failing CI test and tz_localize was previously approved
1 parent ecd4abb commit 6e2d3ae

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

pandas/plotting/_matplotlib/timeseries.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,7 @@ def _maybe_convert_index(ax, data):
251251
freq = frequencies.get_period_alias(freq)
252252

253253
if isinstance(data.index, ABCDatetimeIndex):
254-
if data.index.tz is not None:
255-
data = data.tz_convert(None).to_period(freq=freq)
256-
else:
257-
# can't convert tz-naive
258-
data = data.to_period(freq=freq)
254+
data = data.tz_localize(None).to_period(freq=freq)
259255
elif isinstance(data.index, ABCPeriodIndex):
260256
data.index = data.index.asfreq(freq=freq)
261257
return data

0 commit comments

Comments
 (0)