[BUG] Patch.update mutates a shared mapping and rewrites earlier merges
維護者通常 1 天內回覆
評估
研究方向
Start by locating Patch.update and the code that records its merge operations; the issue provides a reproducer using a shared dictionary and to_json. Check the existing Patch tests for merge behavior, then verify that each location keeps its own amount and the input dictionary remains unchanged. Pull request #4144 is already open for this issue.
由索引模型根據 Issue 內容生成。
描述
Patch.update uses its nonempty dictionary argument as the target for merging
keyword arguments. Reusing that dictionary for two locations in one callback
changes the value already queued for the first location.
import json
from dash import Patch
from dash._utils import to_json
common = {"currency": "USD"}
p = Patch()
p["jan"].update(common, amount=100)
p["feb"].update(common, amount=200)
print(json.dumps(json.loads(to_json(p)), indent=2))
print(common)
Expected merge values are {"currency": "USD", "amount": 100} for jan
and {"currency": "USD", "amount": 200} for feb. common should remain
{"currency": "USD"}. Both serialized merge values instead contain
"amount": 200, and common also gains "amount": 200.
The same callback was exercised in a running Dash app with a dcc.Store and
Chrome. Its actual Store data had amounts 200/200 instead of 100/200. Existing
fields at each location were retained. Distinct dictionary arguments and
keyword-only calls produced the expected 100/200 values.
The native diagnostic run is
https://github.com/peterolkhov/dash/actions/runs/43130587651/job/130893438856.
It checks the actual public producer and running browser, with two ordinary
assertion failures for the shared mapping and four passing controls.
Environment: unchanged Dash dev commit
b5a33c5b9191bef976e352b9feca14eaf93c9b7a, Dash 4.5.0, Python 3.12.16,
Node 24.22.2, Selenium 4.51.0, Chrome/ChromeDriver 157.0.8103.78, and Ubuntu
on a standard GitHub-hosted runner. The full npm run build completed first.
AI assistance was used to investigate and prepare this report. The observed
results above come from the linked native run.
- 主要語言
- Python
- 星號
- 24.5k
- 分支
- 2.3k
- 平均合併
- 3 天 7 小時
- 30 天內合併 PR
- 30
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
plotly/dash 的其他 Issue
-
P2 plotly-internal size: 1 task
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
Extract graph schema validation into properly named test可能已有人在做 @Nice6042 於 90 天前認領。 未關閉good first issue P3 size: 1 task
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
[BUG] dcc.Dropdown: virtualized list keeps the height measured at opening when options grow while the menu is open可能已有人在做 @KoolADE85 於 2 天前認領。 未關閉bug P3 size: 1
plotly/dash#4131 · 1 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
[BUG] `set_props` streaming可能已有人在做 @BSd3v 於 5 天前認領。 未關閉bug P3 size: 1
難度 4/5 3-5 天 新手友好度 35/100
維護者通常 1 天內回覆
-
[BUG] dcc.Upload contents and dcc.Geolocation position docstrings describe the wrong value format可能已有人在做 @ZainnQureshii 於 5 天前認領。 未關閉bug P3 size: 1
難度 1/5 1 小時以內 新手友好度 30/100
維護者通常 1 天內回覆
相似的 Issue
-
[BUG] HTTP lifecycle dispatch treats a NO_PROXY-only environment as corporate egress and skips the resolve-and-pinned session可能已有人在做 @bodapatisaikrishna 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
external
難度 2/5 1-3 小時 新手友好度 65/100
langchain-ai/docs#7652 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 79/100
elastic/oblt-aw#2513 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug p2
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆
-
enhancement
難度 1/5 1 小時以內 新手友好度 75/100
NCAR/CLM-Tutorial#113 · 1 則留言 ·
維護者通常 1 天內回覆