Skip to content

Commit

Permalink
Merge branch 'master' into docs-updates-5-21
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamConnors committed Apr 15, 2024
2 parents eb49162 + b909d48 commit 09404d9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ orjson
dash-bio
jinja2<3.1
parmed<=3.4.4; python_version<"3.8"
dask==2022.2.0
polars
dask==2022.2.0
8 changes: 5 additions & 3 deletions packages/python/plotly/_plotly_utils/optional_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Stand-alone module to provide information about whether optional deps exist.
"""

from importlib import import_module
import logging
import sys
Expand All @@ -19,10 +20,9 @@ def get_module(name, should_load=True):
:return: (module|None) If import succeeds, the module will be returned.
"""
if name in sys.modules:
return sys.modules[name]
if not should_load:
return None
return sys.modules.get(name, None)

if name not in _not_importable:
try:
return import_module(name)
Expand All @@ -32,3 +32,5 @@ def get_module(name, should_load=True):
_not_importable.add(name)
msg = f"Error importing optional module {name}"
logger.exception(msg)

return None
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
requests==2.25.1
tenacity==6.2.0
pytest==6.2.3
pytest==8.1.1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ numpy==1.20.2
xarray==0.17.0
statsmodels
Pillow==8.2.0
pytest==6.2.3
pytest==8.1.1
pytz==2021.1
ipython[all]==7.22.0
ipywidgets==8.0.2
Expand Down

0 comments on commit 09404d9

Please sign in to comment.