| 59 | |
| 60 | |
| 61 | def 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 | |
| 81 | def test_several_dataframes(request, constructor): |