fig['layout'] in _set_axis(), which is an object of plotly.graph_objs.Layout should not be used with del because the class and its all parent classes do not implement __delitem__. So, it will raise AttributeError: __delitem__ instead of KeyError.
So, I fixed it by accessing _props directly. But it might not look good because the underscore + property is usually called inside of an instance method, not the outside of the object. Any comments or fixes will be welcomed!
fig['layout']
in_set_axis()
, which is an object ofplotly.graph_objs.Layout
should not be used withdel
because the class and its all parent classes do not implement__delitem__
. So, it will raiseAttributeError: __delitem__
instead ofKeyError
.So, I fixed it by accessing
_props
directly. But it might not look good because theunderscore + property
is usually called inside of an instance method, not the outside of the object. Any comments or fixes will be welcomed!