MCPcopy Index your code
hub / github.com/plotly/plotly.py / test_series

Function test_series

tests/test_optional/test_px/test_px_input.py:61–78  ·  view source on GitHub ↗
(request, backend)

Source from the content-addressed store, hash-verified

59
60
61def test_series(request, backend):
62 if backend == "pyarrow":
63 # By converting to native, we lose the name for pyarrow chunked_array
64 # and the assertions fail
65 request.applymarker(pytest.mark.xfail)
66
67 tips = nw.from_native(px.data.tips(return_type=backend))
68 before_tip = (tips.get_column("total_bill") - tips.get_column("tip")).to_native()
69 day = tips.get_column("day").to_native()
70 tips = tips.to_native()
71
72 fig = px.bar(tips, x="day", y=before_tip)
73 assert fig.data[0].hovertemplate == "day=%{x}<br>y=%{y}<extra></extra>"
74 fig = px.bar(tips, x="day", y=before_tip, labels={"y": "bill"})
75 assert fig.data[0].hovertemplate == "day=%{x}<br>bill=%{y}<extra></extra>"
76 # lock down that we can pass df.col to facet_*
77 fig = px.bar(tips, x="day", y="tip", facet_row=day, facet_col=day)
78 assert fig.data[0].hovertemplate == "day=%{x}<br>tip=%{y}<extra></extra>"
79
80
81def test_several_dataframes(request, constructor):

Callers

nothing calls this directly

Calls 1

barMethod · 0.45

Tested by

no test coverage detected