8000 Allow pandas import exception to bubble up. · pferate/python-api@7d7ab69 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d7ab69

Browse files
committed
Allow pandas import exception to bubble up.
1 parent e116ff2 commit 7d7ab69

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

plotly/graph_objs/graph_objs.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,12 +1016,8 @@ def get_data(self, flatten=False):
10161016

10171017
def to_dataframe(self):
10181018
data = self.get_data(flatten=True)
1019-
try:
1020-
import pandas as pd
1021-
return pd.DataFrame(dict([(k, pd.Series(v))
1022-
for k, v in data.items()]))
1023-
except ImportError:
1024-
return data
1019+
from pandas import DataFrame, Series
1020+
return DataFrame(dict([(k, Series(v)) for k, v in data.items()]))
10251021
Figure.to_dataframe = to_dataframe
10261022

10271023
def append_trace(self, trace, row, col):

0 commit comments

Comments
 (0)
0