makeplane / makeplane/plane-python-sdk
[bug]: update() strips None values via exclude_none=True, making it impossible to clear nullable fields
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 17
- 派生
- 24
- 平均合并
- 8 天 9 小时
- 30 天内合并 PR
- 2
描述
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.
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 plane/api/work_items/base.py 第 102 行附近开始,然后在其他资源类中搜索相同的 model_dump(exclude_none=True) 模式。在选择两个提议方案中的一个之前,比较更新模型中未设置字段和显式 None 的表示方式。完成标准是:在受影响的资源中,可以清除 nullable 字段,同时不会将省略的字段变成更新。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- api, backend
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100