Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit da91751

Browse files
authored
Merge pull request #85 from plotly/orjson-hack
preemptively import orjson
2 parents 75d6563 + e979104 commit da91751

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
55
## Unreleased
66
### Fixed
77
- Fixed `werkzeug` 2.1.0 import and `skip` calculation, shutdown deprecation warning.
8+
- Work around a partial import of `orjson` when it's installed and you use `mode="jupyterlab"`
89

910
## 0.4.1 - 2022-02-16
1011
### Fixed

jupyter_dash/jupyter_app.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,14 @@ def run_server(
287287
inline_exceptions=inline_exceptions,
288288
)
289289

290+
# prevent partial import of orjson when it's installed and mode=jupyterlab
291+
# TODO: why do we need this? Why only in this mode? Importing here in
292+
# all modes anyway, in case there's a way it can pop up in another mode
293+
try:
294+
import orjson
295+
except ImportError:
296+
pass
297+
290298
@retry(
291299
stop_max_attempt_number=15,
292300
wait_exponential_multiplier=100,

0 commit comments

Comments
 (0)