Skip to content

[BUG]: Unnecessary UserWarning when using fig.write_image() with kaleido.start_sync_server() #5786

Description

@hirohira9119

Description

When using kaleido.start_sync_server(), fig.write_image() emits a UserWarning on every call, even though no kopts are specified.
The warning is:

plotly\io\_kaleido.py:185: UserWarning: The kopts argument is ignored if using a server.
  img_bytes = kaleido.calc_fig_sync(

The image is generated successfully, but since no kopts are specified, it seems that this warning should not be emitted.

It looks like Plotly passes kopts to kaleido.calc_fig_sync() even when no Kaleido options are specified.

Would it be possible for Plotly to avoid passing kopts when no Kaleido options were specified, or otherwise avoid this warning in this case?

Steps to reproduce

import plotly.express as px
import kaleido

fig = px.line(x=[0, 1], y=[0, 1])

kaleido.start_sync_server()
fig.write_image("a.png")  # success, but UserWarning
kaleido.stop_sync_server()

Notes

  • plotly 7.1.0
  • kaleido 1.4.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions