Repository navigation
Conversation
Use return_exceptions with asyncio.gather so a failed chunk's error is not raised while other chunk uploads are still in flight.
Replaces asyncio.gather/to_thread with anyio task groups and to_thread.run_sync. Retired HTTP clients are now closed in aclose() since anyio has no fire-and-forget tasks. Adds anyio dependency.
Emit warnings in a scoped context so caller filters are preserved. Add tests for sync and async decorators, warning attribution, and filter restoration.
Require all service methods, Client.call, and Client.chunked_upload to be awaited. Coroutine on_progress callbacks are also awaited. The SDK now requires Python 3.11 and uses httpx2 instead of requests. Client.aclose() and async context manager support are also documented.
Alias httpx to httpx2 before importing respx for root, service, and standalone test discovery. Treat falsey Appwrite Cloud error codes as unreachable responses.
🔵 Tier A · Mergeable after minor fixes
This PR migrates the Python SDK transport and service APIs to asynchronous httpx2/anyio, adds explicit client-pool lifecycle management, and updates chunked uploads for async progress callbacks. It also updates tests, package metadata, and documentation for the async API and Python 3.11+ requirement. 59 of 76 changed files were too large to include in full.
Note @Xharry01X does not have write access to this repository, so Hansi does not approve automatically. A maintainer can review and approve.
Fix with agent prompt### Issue 1
README.md:139
**The error example references an out-of-scope variable**
In the preceding request example, `users` is created inside `main()`, so it is not visible to this separate `main`; running this error-handling block raises `NameError` before making a request. Create a `Users(client)` instance in this example or define it in a shared scope.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.📂 Walkthrough · 7
Reviewed |
|
This library is auto-generated by the Appwrite SDK Generator, and does not accept pull requests directly. To learn more about how you can help us improve this SDK, please check the contributing guide. |
|
|
||
| async def main(): | ||
| try: | ||
| user = await users.get(user_id='<USER_ID>') |
There was a problem hiding this comment.
The error example references an out-of-scope variable
In the preceding request example, users is created inside main(), so it is not visible to this separate main; running this error-handling block raises NameError before making a request. Create a Users(client) instance in this example or define it in a shared scope.
Prompt To Fix With AI
This is a comment left during a code review.
Path: README.md
Line: 139
Comment:
**The error example references an out-of-scope variable**
In the preceding request example, `users` is created inside `main()`, so it is not visible to this separate `main`; running this error-handling block raises `NameError` before making a request. Create a `Users(client)` instance in this example or define it in a shared scope.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.🟡 Minor · documentation · Reply if this doesn't apply.
What does this PR do?
Migrates the Python SDK from the synchronous requests client to a fully asynchronous implementation built on httpx2 and anyio. All service methods now return coroutines that must be awaited, Client exposes aclose() / async context manager usage, and the underlying connection pool is closed explicitly. Includes thread-safe deprecation warning filters, redirect support for location responses, sibling chunk cleanup on partial upload failures, and refreshed README examples for the async API.
Test Plan?
Ran the full suite with python -m unittest discover -s test -t . — 1008 tests, all passing, with both invocation styles (-s test -t . and from inside test/) verified so the httpx2/respx transport aliasing is active regardless of how tests are started. Also re-ran with HTTPS_PROXY/HTTP_PROXY pointed at a dead address to confirm no test escapes to the network, and compiled every Python block in README.md to confirm the examples are valid, runnable scripts.
Related PRs and Issues?
None.
Have you read the Contributing Guidelines?
Yes.