From 9cd4cd8ceccd38ce662d16e9688552bc444c3475 Mon Sep 17 00:00:00 2001 From: Yi Shen Date: Wed, 12 Feb 2020 00:33:57 -0500 Subject: [PATCH 1/2] a bandage solution --- packages/python/plotly/plotly/express/_core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/python/plotly/plotly/express/_core.py b/packages/python/plotly/plotly/express/_core.py index db8f002c2c1..568936f3c80 100644 --- a/packages/python/plotly/plotly/express/_core.py +++ b/packages/python/plotly/plotly/express/_core.py @@ -928,6 +928,10 @@ def build_dataframe(args, attrables, array_attrables): length = len(df_output) if argument is None: continue + # Ensure the field of "custom_data" is always list + if argument == "custom_data": + if not isinstance(field, list): + field = [field] # Case of multiindex if isinstance(argument, pd.MultiIndex): raise TypeError( From 1c797c94efcda4adc2dcf12b8f745b02e00899a8 Mon Sep 17 00:00:00 2001 From: Yi Shen Date: Wed, 12 Feb 2020 00:50:59 -0500 Subject: [PATCH 2/2] fixed a silly mistake --- packages/python/plotly/plotly/express/_core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/python/plotly/plotly/express/_core.py b/packages/python/plotly/plotly/express/_core.py index 568936f3c80..404dd8012e9 100644 --- a/packages/python/plotly/plotly/express/_core.py +++ b/packages/python/plotly/plotly/express/_core.py @@ -929,9 +929,9 @@ def build_dataframe(args, attrables, array_attrables): if argument is None: continue # Ensure the field of "custom_data" is always list - if argument == "custom_data": - if not isinstance(field, list): - field = [field] + if field == "custom_data": + if not isinstance(argument, list): + argument = [argument] # Case of multiindex if isinstance(argument, pd.MultiIndex): raise TypeError(