[BUG]: Unnecessary `UserWarning` when using `fig.write_image()` with `kaleido.start_sync_server()`
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 74/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
从 plotly/io/_kaleido.py 中第 185 行附近的 kaleido.calc_fig_sync() 调用开始,然后跟踪 fig.write_image() 如何构造其参数。使用 kaleido.start_sync_server() 重现该示例,并确认在未提供任何 Kaleido 选项时不会出现警告,同时对于已提供的选项,现有的警告行为仍然保持不变。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Python
- 星标
- 18.8k
- 派生
- 2.9k
- 平均合并
- 14 小时 12 分钟
- 30 天内合并 PR
- 19
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
plotly/plotly.py 的其他 Issue
-
P3 size: 1 task
难度 2/5 1-3 小时 新手友好度 65/100
plotly/plotly.py#5769 · 1 个 reaction ·
维护者通常 1 天内回复
-
P3 size: 1 task
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug P1
难度 1/5 1 小时以内 新手友好度 68/100
维护者通常 1 天内回复
-
feature P3
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
feature P3
难度 2/5 1-3 小时 新手友好度 72/100
plotly/plotly.py#3859 · 1 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
BasedHardware/omi#20271 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 92/100
openai/openai-cookbook#3153 ·
维护者通常 1 天内回复
-
cvss-severity:high devguard l3montree-cybersecurity/devguard/devguard pkg:golang/github.com/l3montree-dev/devguard risk:low state:open
难度 2/5 1-3 小时 新手友好度 65/100
l3montree-dev/devguard#3146 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
-
bug confirmed issue
难度 2/5 1-3 小时 新手友好度 76/100
open-webui/open-webui#31849 · 2 条评论 ·
维护者通常 1 天内回复