[bug]: update() strips None values via exclude_none=True, making it impossible to clear nullable fields
Maintainer thường phản hồi trong vòng 5 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Bắt đầu tại plane/api/work_items/base.py, khoảng dòng 102, sau đó tìm mẫu model_dump(exclude_none=True) tương tự trong các lớp resource khác. So sánh cách các trường chưa được thiết lập và None tường minh được biểu diễn trong các model cập nhật trước khi chọn giữa hai phương án được đề xuất. Công việc hoàn tất khi có thể xóa các trường nullable mà không biến các trường bị bỏ qua thành các bản cập nhật trong các resource bị ảnh hưởng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 18
- Fork
- 30
- Merge trung bình
- 5 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của makeplane/plane-python-sdk
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
makeplane/plane-python-sdk#60 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
fix: WorkItemAttachments.create() raises ValidationError on actual Plane responseCó thể đã có người làm @volodchenkov đã nhận 207 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
makeplane/plane-python-sdk#33 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
makeplane/plane-python-sdk#21 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
makeplane/plane-python-sdk#20 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Pydantic Error on Work ItemĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
makeplane/plane-python-sdk#15 ·
Maintainer thường phản hồi trong vòng 5 ngày
Tất cả issue của makeplane/plane-python-sdk
Issue tương tự
-
bug harness
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
mruangutai/harness#2687 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
modal-labs/modal-client#4158 ·
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 72/100
The-Swarm-Corporation/swarms-rs#168 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] SMTP listener now binds to EMAIL_PORT instead of 2525 since the gunicorn switch 5.0.3-ls373Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
linuxserver/docker-healthchecks#137 · 1 bình luận ·