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

Commit b6dad26

Browse files
authored
Merge pull request #89 from plotly/run-to-run_server
Support `Dash.run` method.
2 parents 62ea986 + 18f1a02 commit b6dad26

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

Diff for: CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
All notable changes to `jupyter-dash` will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [UNRELEASED]
6+
### Added
7+
8+
- Support for `Dash.run` method added in Dash 2.4.0
9+
510
## 0.4.2 - 2022-03-31
611
### Fixed
712
- Fixed `werkzeug` 2.1.0 import and `skip` calculation, shutdown deprecation warning.

Diff for: jupyter_dash/jupyter_app.py

+15-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def alive():
146146

147147
self.server.logger.disabled = True
148148

149-
def run_server(
149+
def run(
150150
self,
151151
mode=None, width="100%", height=650, inline_exceptions=None,
152152
**kwargs
@@ -173,7 +173,10 @@ def run_server(
173173
``Dash.run_server`` method.
174174
"""
175175
# Get superclass run_server method
176-
super_run_server = super(JupyterDash, self).run_server
176+
if hasattr(dash.Dash, "run"):
177+
super_run_server = super(JupyterDash, self).run
178+
else:
179+
super_run_server = super(JupyterDash, self).run_server
177180

178181
if not JupyterDash._in_ipython:
179182
# If not in IPython context, call run run_server synchronously
@@ -423,6 +426,16 @@ def _wrap_errors(error):
423426

424427
return html_str, 500
425428

429+
def run_server(
430+
self,
431+
mode=None, width="100%", height=650, inline_exceptions=None,
432+
**kwargs
433+
):
434+
self.run(
435+
mode=mode, width=width, height=height, inline_exceptions=inline_exceptions,
436+
**kwargs
437+
)
438+
426439

427440
def _custom_formatargvalues(
428441
args, varargs, varkw, locals,

0 commit comments

Comments
 (0)