Skip to content

fix: preserve explicit nulls in work item updates - #68

Open
81wallace18 wants to merge 1 commit into
makeplane:mainfrom
81wallace18:fix/preserve-work-item-null-updates
Open

fix: preserve explicit nulls in work item updates#68
81wallace18 wants to merge 1 commit into
makeplane:mainfrom
81wallace18:fix/preserve-work-item-null-updates

Conversation

@81wallace18

@81wallace18 81wallace18 commented Aug 24, 2026

Copy link
Copy Markdown

Summary

  • serialize UpdateWorkItem with exclude_unset=True so explicit None values reach the PATCH body
  • continue omitting fields the caller did not supply
  • add a regression test covering date clearing payloads

Addresses the work-item update case reported in #35.

Tests

  • pytest — 86 passed, 298 skipped
  • ruff check plane/api/work_items/base.py tests/unit/test_work_items.py
  • black --check plane/api/work_items/base.py tests/unit/test_work_items.py

Notes

Full-repository Ruff and mypy currently report pre-existing failures outside this two-file change; scoped Ruff and Black checks pass.

Summary by CodeRabbit

  • Bug Fixes
    • Work item updates now correctly preserve fields explicitly set to empty or null values.
    • Fields that were not included in an update remain omitted, preventing unintended changes.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 67d6f6c1-a673-47ec-bf41-ee7aa6e3fb9e

📥 Commits

Reviewing files that changed from the base of the PR and between 31a4f9e and 6fce0c5.

📒 Files selected for processing (2)
  • plane/api/work_items/base.py
  • tests/unit/test_work_items.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

WorkItems.update now preserves explicitly provided None values in PATCH payloads. A unit test verifies that null date fields reach the underlying request method.

Changes

Work item update payload

Layer / File(s) Summary
Update payload and validation
plane/api/work_items/base.py, tests/unit/test_work_items.py
WorkItems.update uses exclude_unset=True, so explicit null values are sent while unset fields are omitted. The unit test verifies the payload for null date fields.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 6fce0

The update now preserves explicitly cleared fields while continuing to omit fields the caller did not provide, with regression coverage added; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: sangeethailango

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes preserving explicitly provided null values in work item updates.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant