Skip to content

Commit edbd796

Browse files
committed
Don't crash if figure_factory is imported but pandas isn't installed. Fixes #941
1 parent e994e55 commit edbd796

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: plotly/figure_factory/__init__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import absolute_import
22

3+
from plotly import optional_imports
4+
35
# Require that numpy exists for figure_factory
46
import numpy
57

@@ -18,4 +20,5 @@
1820
from plotly.figure_factory._table import create_table
1921
from plotly.figure_factory._trisurf import create_trisurf
2022
from plotly.figure_factory._violin import create_violin
21-
from plotly.figure_factory._county_choropleth import create_choropleth
23+
if optional_imports.get_module('pandas') is not None:
24+
from plotly.figure_factory._county_choropleth import create_choropleth

0 commit comments

Comments
 (0)