Skip to content

Commit 463a4db

Browse files
Revert "BUG: record warnings related to DatetimeIndex (pandas-dev#37193)"
This reverts commit 23c41bd.
1 parent 20eaa26 commit 463a4db

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

pandas/tests/plotting/test_datetimelike.py

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -277,16 +277,9 @@ def test_irreg_hf(self):
277277
_, ax = self.plt.subplots()
278278
df2 = df.copy()
279279
df2.index = df.index.astype(object)
280-
with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
281-
# This warning will be emitted
282-
# pandas/core/frame.py:3216:
283-
# FutureWarning: Automatically casting object-dtype Index of datetimes
284-
# to DatetimeIndex is deprecated and will be removed in a future version.
285-
# Explicitly cast to DatetimeIndex instead.
286-
# return klass(values, index=self.index, name=name, fastpath=True)
287-
df2.plot(ax=ax)
288-
diffs = Series(ax.get_lines()[0].get_xydata()[:, 0]).diff()
289-
assert (np.fabs(diffs[1:] - sec) < 1e-8).all()
280+
df2.plot(ax=ax)
281+
diffs = Series(ax.get_lines()[0].get_xydata()[:, 0]).diff()
282+
assert (np.fabs(diffs[1:] - sec) < 1e-8).all()
290283

291284
def test_irregular_datetime64_repr_bug(self):
292285
ser = tm.makeTimeSeries()
@@ -997,16 +990,9 @@ def test_irreg_dtypes(self):
997990
# np.datetime64
998991
idx = date_range("1/1/2000", periods=10)
999992
idx = idx[[0, 2, 5, 9]].astype(object)
1000-
with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
1001-
# This warning will be emitted
1002-
# pandas/core/frame.py:3216:
1003-
# FutureWarning: Automatically casting object-dtype Index of datetimes
1004-
# to DatetimeIndex is deprecated and will be removed in a future version.
1005-
# Explicitly cast to DatetimeIndex instead.
1006-
# return klass(values, index=self.index, name=name, fastpath=True)
1007-
df = DataFrame(np.random.randn(len(idx), 3), idx)
1008-
_, ax = self.plt.subplots()
1009-
_check_plot_works(df.plot, ax=ax)
993+
df = DataFrame(np.random.randn(len(idx), 3), idx)
994+
_, ax = self.plt.subplots()
995+
_check_plot_works(df.plot, ax=ax)
1010996

1011997
def test_time(self):
1012998
t = datetime(1, 1, 1, 3, 30, 0)

0 commit comments

Comments
 (0)