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

Function test_pass_df_columns

tests/test_optional/test_px/test_px_input.py:494–507  ·  view source on GitHub ↗
(backend)

Source from the content-addressed store, hash-verified

492
493
494def test_pass_df_columns(backend):
495 tips = nw.from_native(px.data.tips(return_type=backend))
496 fig = px.histogram(
497 tips.to_native(),
498 x="total_bill",
499 y="tip",
500 color="sex",
501 marginal="rug",
502 hover_data=tips.columns,
503 )
504 # the "- 2" is because we re-use x and y in the hovertemplate where possible
505 assert fig.data[1].hovertemplate.count("customdata") == len(tips.columns) - 2
506 tips_copy = nw.from_native(px.data.tips(return_type=backend))
507 assert tips_copy.columns == tips.columns
508
509
510def test_size_column(request, backend):

Callers

nothing calls this directly

Calls 2

histogramMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected