diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e9a68fd8d..faaafa39b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [6.0.2] - 2025-03-02 + +### Fixed +- Fix `ValueError` when dragging and dropping a `FigureWidget` shape. + ## [6.0.1] - 2025-02-16 ### Fixed diff --git a/plotly/basedatatypes.py b/plotly/basedatatypes.py index a3044f6763..290615cc64 100644 --- a/plotly/basedatatypes.py +++ b/plotly/basedatatypes.py @@ -4682,6 +4682,7 @@ def __getitem__(self, prop): CompoundArrayValidator, BaseDataValidator, ) + from .validators.layout._shapes import ShapesValidator # Normalize prop # -------------- @@ -4707,7 +4708,6 @@ def __getitem__(self, prop): ) validator = self._get_validator(prop) - if isinstance(validator, CompoundValidator): if self._compound_props.get(prop, None) is None: # Init compound objects @@ -4719,6 +4719,12 @@ def __getitem__(self, prop): self._compound_props[prop]._plotly_name = prop return validator.present(self._compound_props[prop]) + elif isinstance(validator, ShapesValidator): + props = [] + if self._props is not None and prop in self._props: + props = [validator.data_class() for _ in self._props.get(prop, [])] + + return validator.present(props) elif isinstance(validator, (CompoundArrayValidator, BaseDataValidator)): if self._compound_array_props.get(prop, None) is None: # Init list of compound objects