Skip to content

Commit 0d0375a

Browse files
committed
Update scatter plot test to support datetime.time data
Datetime.time is now supported in scatter plots due to added converter implementation in ScatterPlot. Removed the test expecting a TypeError and updated it to validate the new functionality.
1 parent b96cf2d commit 0d0375a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

pandas/tests/plotting/frame/test_frame.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -840,14 +840,12 @@ def test_plot_scatter_shape(self):
840840
axes = df.plot(x="x", y="y", kind="scatter", subplots=True)
841841
_check_axes_shape(axes, axes_num=1, layout=(1, 1))
842842

843-
def test_raise_error_on_datetime_time_data(self):
844-
# GH 8113, datetime.time type is not supported by matplotlib in scatter
843+
def test_scatter_on_datetime_time_data(self):
844+
# datetime.time type is now supported in scatter, since a converter
845+
# is implemented in ScatterPlot
845846
df = DataFrame(np.random.default_rng(2).standard_normal(10), columns=["a"])
846847
df["dtime"] = date_range(start="2014-01-01", freq="h", periods=10).time
847-
msg = "must be a string or a (real )?number, not 'datetime.time'"
848-
849-
with pytest.raises(TypeError, match=msg):
850-
df.plot(kind="scatter", x="dtime", y="a")
848+
df.plot(kind="scatter", x="dtime", y="a")
851849

852850
@pytest.mark.parametrize("x, y", [("dates", "vals"), (0, 1)])
853851
def test_scatterplot_datetime_data(self, x, y):

0 commit comments

Comments
 (0)