🚀 Feature: Python SDK does not validate row data against table schema before insertion · Issue #134 · appwrite/sdk-for-python · GitHub
Skip to content

🚀 Feature: Python SDK does not validate row data against table schema before insertion #134

Open

Description

@kamatealip

🔖 Feature description

The Python SDK allows defining table schemas (required fields, data types, defaults), but create_row does not perform any client-side validation against this schema.

As a result, issues like missing required fields or incorrect data types are only caught server-side after the API request, leading to delayed and less clear errors.

🎤 Pitch

The Python SDK already has full knowledge of the table schema at creation time (required fields, data types, defaults), but this information is not used when inserting rows. This leads to avoidable runtime errors that are only discovered after a network request.

  • Adding optional client-side validation would:

  • Catch simple mistakes (missing required fields, wrong data types) immediately

  • Provide clearer, Python-native error messages

  • Reduce unnecessary API calls and debugging time

  • Improve onboarding and overall developer experience

This does not replace server-side validation, but complements it by shifting basic checks closer to the developer.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Activity

  1. GauravPatil2515 commented on Oct 12, 2026

    @GauravPatil2515

    Hi @eldadfux @stefanslo @PineappleIAP! 👋

    I'd love to work on implementing client-side row validation against the table schema for the Python SDK.

    Proposed Implementation Plan:

    1. Schema Validation Helper: Add a lightweight schema validator in appwrite/services/databases.py (or a dedicated validation utility) that inspects required fields, expected primitive types (string, integer, float, boolean), and default values prior to sending the network request.
    2. Graceful Error Surfacing: Raise an informative AppwriteException with clear, descriptive details (e.g., Missing required attribute: 'title' or Invalid type for 'age': expected int, got str) before dispatching the HTTP call.
    3. Unit Tests: Add comprehensive unit test coverage in test/services/test_databases.py verifying valid row payloads, missing required attributes, and type mismatches.

    Could you please assign this issue to me? Thanks!

  2. pathariyashashi commented on Oct 16, 2026

    @pathariyashashi

    Hi maintainers,

    I'd like to contribute to this issue and help improve the Python SDK.

    I noticed that this repository is marked READ-ONLY and the SDK is auto-generated. Should this change be implemented in the Appwrite SDK Generator instead?

    I also noticed that another contributor has expressed interest in working on this issue, so I don't want to duplicate their efforts.

    Could you please clarify the recommended contribution path and whether there is an opportunity for me to help?

    Thank you!

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions