Skip to content

Commit 186bd75

Browse files
committed
import orjson on initial load
1 parent 586aeeb commit 186bd75

File tree

1 file changed

+4
-0
lines changed
  • packages/python/plotly/plotly/io

1 file changed

+4
-0
lines changed

Diff for: packages/python/plotly/plotly/io/_json.py

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
from _plotly_utils.optional_imports import get_module
99
from _plotly_utils.basevalidators import ImageUriValidator
1010

11+
# Ensure `orjson` module is loaded immediately if present (to avoid error on hot reload)
12+
get_module("orjson", should_load=True)
13+
1114

1215
# Orca configuration class
1316
# ------------------------
@@ -105,6 +108,7 @@ def to_json_plotly(plotly_object, pretty=False, engine=None):
105108
--------
106109
to_json : Convert a plotly Figure to JSON with validation
107110
"""
111+
108112
orjson = get_module("orjson", should_load=True)
109113

110114
# Determine json engine

0 commit comments

Comments
 (0)