Skip to content

Commit 052e2c1

Browse files
committed
added: ignore facet args with empty dataset
1 parent 133ac09 commit 052e2c1

File tree

1 file changed

+4
-0
lines changed
  • packages/python/plotly/plotly/express

1 file changed

+4
-0
lines changed

packages/python/plotly/plotly/express/_core.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,6 +1988,10 @@ def make_figure(args, constructor, trace_patch=None, layout_patch=None):
19881988
layout_patch = layout_patch or {}
19891989
apply_default_cascade(args)
19901990

1991+
# Ignore facet rows and columns when data frame is empty so as to prevent nrows/ncols equaling 0
1992+
if len(args["data_frame"]) == 0:
1993+
args["facet_row"] = args["facet_col"] = None
1994+
19911995
args = build_dataframe(args, constructor)
19921996
if constructor in [go.Treemap, go.Sunburst, go.Icicle] and args["path"] is not None:
19931997
args = process_dataframe_hierarchy(args)

0 commit comments

Comments
 (0)