Skip to content

Commit

Permalink
Add JSON test for serializing customdata as numpy array
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmmease committed Jul 8, 2021
1 parent 5453155 commit dba2bee
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest
import plotly.io.json as pio
import plotly.graph_objects as go
import plotly.express as px
import numpy as np
import pandas as pd
import json
Expand Down Expand Up @@ -202,3 +203,9 @@ def to_str(v):
expected = build_test_dict_string(array_str)
assert result == expected
check_roundtrip(result, engine=engine, pretty=pretty)


def test_object_array(engine, pretty):
fig = px.scatter(px.data.tips(), x="total_bill", y="tip", custom_data=["sex"])
result = fig.to_plotly_json()
check_roundtrip(result, engine=engine, pretty=pretty)

0 comments on commit dba2bee

Please sign in to comment.