Skip to content

Commit 0deae65

Browse files
committed
Add check for empty data and raise helpful message.
1 parent 75c4923 commit 0deae65

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

plotly/plotly/plotly.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ def plot(figure_or_data, validate=True, **plot_options):
164164
"plot option.\nHere's why you're "
165165
"seeing this error:\n\n{0}"
166166
"".format(err))
167+
if not figure['data']:
168+
raise exceptions.PlotlyEmptyDataError(
169+
"Empty data list found. Make sure that you populated the "
170+
"list of data objects you're sending and try again.\n"
171+
"Questions? [email protected]"
172+
)
167173
for entry in figure['data']:
168174
for key, val in list(entry.items()):
169175
try:

0 commit comments

Comments
 (0)