Open dejfh opened 3 months ago
Minimum Working Example (MWE): Here is a minimal example that reproduces the issue:
python Copy code import plotly.graph_objects as go
fig = go.Figure()
with fig.batch_update(): fig.add_vline(1) When batch_update() is removed, the code works fine:
python Copy code import plotly.graph_objects as go
fig = go.Figure()
fig.add_vline(1) Expected Behavior: The add_vline() method should be compatible with the batch_update() context and should not raise any errors. The vertical line should be added while benefitting from the performance improvements of batch mode.
Actual Behavior: When the add_vline() method is called within batch_update(), a TypeError is raised, which appears to be related to appending a NoneType to a string at line 3995 in basedatatypes.py of Plotly's internal code.
I am using plotly 5.24.0 with python 3.10.12 in a vs-code interactive window.
The following example raises
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
in[...]/site-packages/plotly/basedatatypes.py:3995
The same example without batch mode works fine: