Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions packages/python/plotly/plotly/basedatatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3862,18 +3862,17 @@ def _perform_update(plotly_obj, update_obj, overwrite=False):
# This should be valid even if xaxis2 hasn't been initialized:
# >>> layout.update(xaxis2={'title': 'xaxis 2'})
for key in update_obj:
# special handling for missing keys that match _subplot_re_match
if key not in plotly_obj and isinstance(plotly_obj, BaseLayoutType):
# try _subplot_re_match
match = plotly_obj._subplot_re_match(key)
if match:
# We need to create a subplotid object
plotly_obj[key] = {}
continue

err = _check_path_in_prop_tree(plotly_obj, key, error_cast=ValueError)
if err is not None:
if isinstance(plotly_obj, BaseLayoutType):
# try _subplot_re_match
match = plotly_obj._subplot_re_match(key)
if match:
# We need to create a subplotid object
plotly_obj[key] = {}
continue
# If no match, raise the error, which should already
# contain the _raise_on_invalid_property_error
# generated message
raise err

# Convert update_obj to dict
Expand Down Expand Up @@ -4778,7 +4777,7 @@ def __contains__(self, prop):
else:
return False
else:
if obj is not None and p in obj._valid_props:
if hasattr(obj, "_valid_props") and p in obj._valid_props:
obj = obj[p]
else:
return False
Expand Down