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.
|
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. |
🟡 Tier B · Needs changes before merging
This PR replaces the SDK’s synchronous HTTP transport with a pooled async client and converts generated service methods and chunked uploads to async. It also updates packaging metadata, documentation, and tests for asynchronous usage. 56 of 73 changed files were too large to include in full.
Fix with agent prompt### Issue 1
appwrite/client.py:225
**Allow 3xx responses for location requests**
With redirects disabled for `response_type='location'`, `httpx2.Response.raise_for_status()` raises on 3xx responses before the `Location` header is returned. `Account.create_o_auth2_token` relies on this redirect response, so OAuth login now raises `AppwriteException` instead of returning the redirect URL.
### Issue 2
appwrite/utils/deprecated.py:37
**Keep the warning filter change out of the awaited request**
`warnings.filters` is process-global, and this `await` keeps the temporary `always` filter active for the entire API request before the `finally` resets it to `default`. During that time unrelated warnings in other tasks or threads bypass callers’ configured filters, and the reset overwrites any custom filters.
### Issue 3
README.md:98
**Run the async rows example's main function**
This example defines `main()` but never invokes it, so copying the snippet performs neither the row creation nor the list request. Unlike the earlier async example, it is missing an `asyncio.run(main())` call.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.📂 Walkthrough · 7
Reviewed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Migrates the Python SDK from a synchronous
requestsclient to a fully asynchronoushttpx2client, and moves the SDK's concurrency primitives fromasynciotoanyio.This is a breaking change. Every service method is now a coroutine and must be awaited.
Async client
Clientnow owns a pooledhttpx2.AsyncClientinstead of issuing per-callrequestsrequests. It supports both an explicit shutdown and the async context manager protocol: