Skip to content

feat: Python SDK update for version 18.0.0#140

Merged
abnegate merged 2 commits intomainfrom
dev
Apr 16, 2026
Merged

feat: Python SDK update for version 18.0.0#140
abnegate merged 2 commits intomainfrom
dev

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

@ChiragAgg5k ChiragAgg5k commented Apr 15, 2026

This PR contains updates to the Python SDK for version 18.0.0.

What's Changed

  • [BREAKING] Renamed Webhook model fields: securitytls, httpUserauthUsername, httpPassauthPassword, signatureKeysecret
  • [BREAKING] Renamed Webhook service parameters to match: securitytls, httpUserauthUsername, httpPassauthPassword
  • [BREAKING] Renamed Webhooks.update_signature() to Webhooks.update_secret() with new optional secret parameter
  • Added Client.get_headers() method to retrieve request headers
  • Added secret parameter to Webhook create and update methods
  • Added x OAuth provider to OAuthProvider enum
  • Added userType field to Log model
  • Added purge parameter to update_collection and update_table for cache invalidation
  • Added Project service: platform CRUD, key CRUD, protocol/service status management
  • Added new models: Key, KeyList, Project, DevKey, MockNumber, AuthProvider, PlatformAndroid, PlatformApple, PlatformLinux, PlatformList, PlatformWeb, PlatformWindows, BillingLimits, Block
  • Added new enums: PlatformType, ProtocolId, ServiceId
  • Updated BuildRuntime, Runtime enums with dart-3.11 and flutter-3.41
  • Updated Scopes enum with keys_read, keys_write, platforms_read, platforms_write
  • Updated X-Appwrite-Response-Format header to 1.9.1
  • Updated TTL description for list caching in Databases and TablesDB
  • Simplified _parse_response() by removing union_models parameter

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 15, 2026

Greptile Summary

This PR updates the Python SDK to version 18.0.0, adding key/platform management endpoints, new BillingLimits, Block, AuthProvider, and platform subtype models, renaming webhook fields (securitytls, httpUserauthUsername, httpPassauthPassword), and replacing the union_models approach in _parse_response with explicit type-dispatching in get_attribute, get_column, and get_platform — the three dispatchers from previous review rounds are now correctly implemented.

Several previously flagged nullability bugs remain open: Key.expire, DevKey.expire, Webhook.secret, and Project.billinglimits are all required non-nullable fields on models where the server can legally return null, and webhooks.create still unconditionally sends secret: null in the request body when the caller omits the argument.

Confidence Score: 3/5

Not safe to merge — several previously-flagged P1 nullability bugs in Key, DevKey, Webhook, and Project models remain unaddressed and will cause ValidationError at runtime in common scenarios.

The three critical dispatch regressions from the last round (get_platform, get_attribute, get_column) are now correctly fixed, which is meaningful progress. However, at least four P1 issues remain open: (1) Key.expire and DevKey.expire are non-Optional str fields but the server returns null for unlimited-expiry keys; (2) Webhook.secret is required but only returned on creation/rotation; (3) Project.billinglimits is required but may be null for non-billed projects; (4) webhooks.create unconditionally sends "secret": null instead of omitting the key.

appwrite/models/key.py, appwrite/models/dev_key.py, appwrite/models/webhook.py, appwrite/models/project.py (billinglimits field), and appwrite/services/webhooks.py (create/update_secret unconditional secret param)

Important Files Changed

Filename Overview
appwrite/service.py Removed union_models parameter from _parse_response, simplifying dispatch to single-model; _normalize_value correctly handles Enum values via .value
appwrite/services/project.py Large new service with key/platform CRUD, protocol/service status toggling; get_platform correctly dispatches by type string, but relies on Project and Key models that have previously-flagged nullability bugs
appwrite/services/databases.py get_attribute now dispatches correctly by type/format; adds purge param to update_collection; note that type == 'datetime' dispatch differs from how email/enum/url/ip use format — valid if server uses a first-class datetime type
appwrite/services/tables_db.py get_column correctly dispatches by type/format mirroring the databases fix; adds purge param to update_table; same datetime dispatch note as databases.py
appwrite/services/webhooks.py Renames security→tls, httpUser→authUsername, httpPass→authPassword, adds secret param; secret is still unconditionally added to api_params in both create and update_secret (previously flagged, not fixed)
appwrite/models/project.py New 258-line model; billinglimits, Key.expire/DevKey.expire within nested lists, and Webhook.secret within nested webhooks list are all non-Optional required fields that break parsing in common scenarios (previously flagged, not fixed)
appwrite/models/webhook.py Field renames security→tls, httpUser→authUsername, httpPass→authPassword, adds secret: str = Field(...) required; secret is not Optional though it is only returned on creation/rotation (previously flagged, not fixed)
appwrite/models/key.py New model; expire: str = Field(...) must be Optional[str] since unlimited-expiry keys return expire: null — parsing any such key will raise ValidationError (previously flagged, not fixed)
appwrite/models/dev_key.py New model; same expire: str = Field(...) non-Optional issue as key.py (previously flagged, not fixed)
appwrite/models/platform_list.py New model; Union[PlatformWeb, PlatformApple, ...] without a discriminator (previously flagged, not fixed); each platform subtype has a unique required field so parsing works but is O(n) with silent fallback risk
appwrite/client.py Version bump 17→18, response format 1.9.0→1.9.1, adds get_headers() returning a shallow copy of _global_headers
appwrite/enums/platform_type.py New enum with five platform types (windows, apple, android, linux, web); correctly registered in ValueClassEncoder
appwrite/models/block.py New model with correct Optional fields for reason and expiredat
appwrite/models/billing_limits.py New model with all required float fields; correct structure — nullability concern lives in Project where it is embedded

Reviews (7): Last reviewed commit: "chore: update Python SDK to 18.0.0" | Re-trigger Greptile

Comment thread appwrite/services/webhooks.py
Comment thread appwrite/models/project.py
Comment thread appwrite/models/platform_list.py
Comment thread appwrite/services/webhooks.py
@ChiragAgg5k ChiragAgg5k changed the title feat: Python SDK update for version 17.1.0 feat: Python SDK update for version 18.0.0 Apr 15, 2026
@ChiragAgg5k ChiragAgg5k changed the title feat: Python SDK update for version 18.0.0 feat: SDK update for version 18.0.0 Apr 15, 2026
Comment thread appwrite/models/key.py
Comment thread appwrite/models/dev_key.py
@ChiragAgg5k ChiragAgg5k changed the title feat: SDK update for version 18.0.0 feat: Python SDK update for version 18.0.0 Apr 15, 2026
@ChiragAgg5k ChiragAgg5k changed the title feat: Python SDK update for version 18.0.0 feat: SDK update for version 18.0.0 Apr 15, 2026
Comment thread appwrite/models/project.py
Comment thread appwrite/models/webhook.py
@ChiragAgg5k ChiragAgg5k changed the title feat: SDK update for version 18.0.0 feat: Python SDK update for version 18.0.0 Apr 15, 2026
Comment thread appwrite/services/project.py Outdated
Comment thread appwrite/services/databases.py Outdated
Comment thread appwrite/services/tables_db.py Outdated
@abnegate abnegate merged commit 63486c7 into main Apr 16, 2026
1 check passed
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.

2 participants