Skip to content

Commit dba2bee

Browse files
committed
Add JSON test for serializing customdata as numpy array
1 parent 5453155 commit dba2bee

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: packages/python/plotly/plotly/tests/test_io/test_to_from_plotly_json.py

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pytest
22
import plotly.io.json as pio
33
import plotly.graph_objects as go
4+
import plotly.express as px
45
import numpy as np
56
import pandas as pd
67
import json
@@ -202,3 +203,9 @@ def to_str(v):
202203
expected = build_test_dict_string(array_str)
203204
assert result == expected
204205
check_roundtrip(result, engine=engine, pretty=pretty)
206+
207+
208+
def test_object_array(engine, pretty):
209+
fig = px.scatter(px.data.tips(), x="total_bill", y="tip", custom_data=["sex"])
210+
result = fig.to_plotly_json()
211+
check_roundtrip(result, engine=engine, pretty=pretty)

0 commit comments

Comments
 (0)