docs: update Python quickstart with Pydantic models for type-safe data access#2788
docs: update Python quickstart with Pydantic models for type-safe data access#2788ChiragAgg5k wants to merge 2 commits intomainfrom
Conversation
…a access - Add Pydantic Todo model for type-safe row operations - Update seed_database() to use model instances with model_dump() - Update list_rows() calls to use model_type parameter - Fix dictionary access to use attribute access (todo.data.title) - Update pip install command to use latest version - Add uv install alternative
WalkthroughThis pull request updates documentation examples across multiple pages: it replaces bracket notation with dot notation for transaction IDs (e.g., Estimated code review effortsrc/routes/docs/products/databases/operators/+page.markdoc src/routes/docs/products/databases/transactions/+page.markdoc src/routes/docs/quick-starts/python/+page.markdoc src/routes/docs/sdks/+page.markdoc 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/routes/docs/quick-starts/python/`+page.markdoc:
- Around line 225-265: The three functions get_todos, get_completed_todos, and
get_incomplete_todos use an unsupported model_type=Todo in tablesDB.list_rows
and then access todo.data.title which will fail; remove the model_type=Todo
argument from each list_rows call and change the item field access to use the
returned dict keys (e.g., todo['title'], todo['description'],
todo['isComplete']) instead of todo.data.* while keeping the same queries and
pagination options.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: be06d40f-42e1-48ad-b512-198409bac46f
📒 Files selected for processing (3)
src/routes/docs/products/databases/operators/+page.markdocsrc/routes/docs/products/databases/transactions/+page.markdocsrc/routes/docs/quick-starts/python/+page.markdoc
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/routes/docs/sdks/`+page.markdoc:
- Around line 23-50: The docs list incorrect versions for the Python and Go
SDKs; locate the Python SDK entry showing "Python SDK `16.0.0`" and update the
version string to "v15.3.0", and locate the Go SDK entry showing "Go SDK
`1.0.0`" and update it to "v0.17.0"; ensure the markdown/markdoc entries (the
SDK name lines and any adjacent link references) are updated consistently so the
displayed versions match the GitHub releases and then save/commit the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 003a65e8-1df5-4d05-a2e2-0322c9ebff33
📒 Files selected for processing (1)
src/routes/docs/sdks/+page.markdoc
Summary
This PR updates the Python quick-start documentation to use Pydantic models for type-safe data access with the Appwrite Python SDK.
Changes Made
Todomodel definition for type-safe data accessseed_database()to createTodomodel instances and use.model_dump()for serializationlist_rows()calls to usemodel_type=Todoparameter for type-safe row retrievaltodo['title']) to attribute access (todo.data.title)pip install appwrite)uv add appwriteas an alternative installation methodBenefits
Related Issue
Type of Change
Test Plan
Checklist
Summary by CodeRabbit