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

Function test_date_in_hover

tests/test_optional/test_px/test_px_hover.py:187–196  ·  view source on GitHub ↗
(constructor)

Source from the content-addressed store, hash-verified

185
186
187def test_date_in_hover(constructor):
188 df = nw.from_native(
189 constructor({"date": ["2015-04-04 19:31:30+0100"], "value": [3]})
190 ).with_columns(date=nw.col("date").str.to_datetime(format="%Y-%m-%d %H:%M:%S%z"))
191 fig = px.scatter(df.to_native(), x="value", y="value", hover_data=["date"])
192
193 # Check that what gets displayed is the local datetime
194 assert nw.to_py_scalar(fig.data[0].customdata[0][0]) == nw.to_py_scalar(
195 df.item(row=0, column="date")
196 ).replace(tzinfo=None)

Callers

nothing calls this directly

Calls 3

constructorFunction · 0.85
scatterMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected