Skip to content

Commit 71ea4a4

Browse files
committed
Handle list/tuple of graph objects when validate=False
1 parent 06d303d commit 71ea4a4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Diff for: packages/python/plotly/plotly/basedatatypes.py

+12
Original file line numberDiff line numberDiff line change
@@ -3548,10 +3548,22 @@ def __setitem__(self, prop, value):
35483548
else:
35493549
# Make sure properties dict is initialized
35503550
self._init_props()
3551+
35513552
if isinstance(value, BasePlotlyType):
35523553
# Extract json from graph objects
35533554
value = value.to_plotly_json()
35543555

3556+
# Check for list/tuple of graph objects
3557+
if (
3558+
isinstance(value, (list, tuple))
3559+
and value
3560+
and isinstance(value[0], BasePlotlyType)
3561+
):
3562+
value = [
3563+
v.to_plotly_json() if isinstance(v, BasePlotlyType) else v
3564+
for v in value
3565+
]
3566+
35553567
self._props[prop] = value
35563568

35573569
# Remove any already constructed graph object so that it will be

0 commit comments

Comments
 (0)