[bug]: update() strips None values via exclude_none=True, making it impossible to clear nullable fields
维护者通常 5 天内回复
评估
调研方向
从 plane/api/work_items/base.py 第 102 行附近开始,然后在其他资源类中搜索相同的 model_dump(exclude_none=True) 模式。在选择两个提议方案中的一个之前,比较更新模型中未设置字段和显式 None 的表示方式。完成标准是:在受影响的资源中,可以清除 nullable 字段,同时不会将省略的字段变成更新。
由索引模型根据 Issue 内容生成。
描述
Summary
The update() method on every resource class strips None values from the payload via model_dump(exclude_none=True),
making it impossible to clear any nullable field on an existing work item (or any other resource using the same
pattern).
Reproducer
# Setup: work item with target_date = "2026-05-17"
data = UpdateWorkItem(target_date=None)
client.work_items.update(
workspace_slug=ws, project_id=p, work_item_id=w, data=data,
)
# Expected: target_date cleared to null
# Actual: silent no-op — target_date still 2026-05-17
# Wire body sent: {} (None stripped by exclude_none=True)
Root cause
plane/api/work_items/base.py line 102 (same pattern in other resources):
response = self._patch(
f"{workspace_slug}/projects/{project_id}/work-items/{work_item_id}",
data.model_dump(exclude_none=True),
)
exclude_none=True conflates two distinct user intents: "do not update this field" and "clear this field to null."
Impact
Affects every nullable field on every resource using this pattern: target_date, start_date, parent, point,
description_html, assignees (back to empty), etc. Currently the only workaround is clearing in the Plane web UI.
Proposed fix (two viable shapes)
A. Switch to exclude_unset=True + explicit None for clears
- Caller passes
Noneto mean "clear," and omits the field entirely to mean "don't change." - Requires the data model to distinguish unset from None (Pydantic v2 supports this natively).
- Breaking change for callers that currently pass
Noneexpecting "don't change."
B. Add explicit clear: list[str] parameter to update() methods
- Caller passes e.g.
clear=["target_date", "parent"]and the wrapper injectsnullfor those fields after
model_dump. - Non-breaking; opt-in.
- More verbose but unambiguous.
Happy to send a PR with whichever shape the maintainers prefer.
Environment
plane-sdk0.2.10 (also present onmainHEAD as of 2026-05-17)- Plane Cloud workspace
- Discovered via
plane-mcp-server'supdate_work_itemtool, but the bug is in the SDK, not the MCP wrapper.
- 主要语言
- Python
- 星标
- 18
- 派生
- 30
- 平均合并
- 5 天 6 小时
- 30 天内合并 PR
- 7
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
makeplane/plane-python-sdk 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
makeplane/plane-python-sdk#60 ·
维护者通常 5 天内回复
-
fix: WorkItemAttachments.create() raises ValidationError on actual Plane response可能已有人在做 @volodchenkov 于 207 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
makeplane/plane-python-sdk#33 ·
维护者通常 5 天内回复
-
难度 5/5 一周以上 新手友好度 15/100
makeplane/plane-python-sdk#21 ·
维护者通常 5 天内回复
-
难度 5/5 一周以上 新手友好度 15/100
makeplane/plane-python-sdk#20 ·
维护者通常 5 天内回复
-
难度 3/5 1-2 天 新手友好度 45/100
makeplane/plane-python-sdk#15 ·
维护者通常 5 天内回复
查看 makeplane/plane-python-sdk 的全部 Issue
相似的 Issue
-
bug harness
难度 2/5 1-3 小时 新手友好度 72/100
mruangutai/harness#2687 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
modal-labs/modal-client#4158 ·
-
good first issue
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 72/100
The-Swarm-Corporation/swarms-rs#168 ·
维护者通常 1 天内回复
-
[BUG] SMTP listener now binds to EMAIL_PORT instead of 2525 since the gunicorn switch 5.0.3-ls373未关闭
难度 2/5 1-3 小时 新手友好度 72/100
linuxserver/docker-healthchecks#137 · 1 条评论 ·