From d8619b952bbfc23074d5a682e30f6faca06157a4 Mon Sep 17 00:00:00 2001 From: seshan18 Date: Fri, 28 Aug 2026 13:45:13 +0530 Subject: [PATCH 1/2] Fix FigureWidget compound array property synchronization (Fixes #5689) --- plotly/basedatatypes.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plotly/basedatatypes.py b/plotly/basedatatypes.py index d81ba0950c..121ae52b73 100644 --- a/plotly/basedatatypes.py +++ b/plotly/basedatatypes.py @@ -5458,6 +5458,16 @@ def _dispatch_change_callbacks(self, changed_paths): ------- None """ + # Invalidate cache for changed compound array properties so that they are + # reconstructed from the underlying properties dictionary on the next access. + # We only pop from _compound_array_props because compound arrays are immutable + # tuples that must be rebuilt to reflect added or removed elements. + for path in changed_paths: + if len(path) > 0: + prop = path[0] + if prop in self._compound_array_props: + self._compound_array_props.pop(prop, None) + # Loop over registered callbacks # ------------------------------ for prop_path_tuples, callbacks in self._change_callbacks.items(): From fb820890ba3f9d1a81c6279d3ef4c1ac923bb301 Mon Sep 17 00:00:00 2001 From: seshan18 Date: Fri, 28 Aug 2026 15:23:37 +0530 Subject: [PATCH 2/2] Add changelog entry for FigureWidget array property fix (#5689) --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd91e4979a..b061046442 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added - Support `marginal_x`/`marginal_y="heatmap"` in `density_heatmap`, drawing a single-row/column heatmap strip in the margin colored by the same `z`/`histfunc` aggregate as the main plot and sharing its color scale [[#5706](https://github.com/plotly/plotly.py/issues/5706)], with thanks to @lucasjamar for the contribution! +### Fixed +- Fix `FigureWidget` state synchronization bug where frontend modifications to array properties (like `layout.shapes`) failed to properly update the Python property cache and occasionally surfaced `Undefined` objects [[#5689](https://github.com/plotly/plotly.py/issues/5689)] + ## [7.0.0] - 2026-08-25 ### Fixed