Skip to content

Replace pydantic v1 .dict() with .model_dump() in the API #67

Description

@ldbumble

We require pydantic>=2, but taskuary/server.py still calls the v1 method body.dict() in ten places. Each call logs PydanticDeprecatedSince20: The dict method is deprecated; use model_dump instead, and it stops working in pydantic v3.

Where: grep -n "\.dict()" taskuary/server.py - ten hits (task create/update, split, calendar prep, fixtures, three settings-style updates).

Done when each is .model_dump() and the suite passes.

Test - a small tests/test_no_pydantic_v1.py that scans taskuary/server.py for .dict() called on request bodies (body.dict(, .second.dict(, .first.dict() and fails if any remain.


Getting started: pip install -e ".[dev]", then python -m pytest -q (offline, a few seconds). UI work: cd website && npm ci && npm test. See CONTRIBUTING.md. One small PR with the change and its test is perfect.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions