feat(utils): refactor supabase_utils.http to be client agnostic#1433
Merged
feat(utils): refactor supabase_utils.http to be client agnostic#1433
Conversation
now, we should be able to provide adapters for different http clients, like httpx, aiohttp, niquests, requests and so on.
add `httpx` and `aiohttp` as an optional-dependency, remove the necessity to hard code httpx everywhere. also parametrize the tests to receive the specific http client as part of the testing, and to not need to duplicate every test case
mandarini
approved these changes
Apr 8, 2026
Contributor
Code reviewFound 6 issues:
supabase-py/src/postgrest/src/postgrest/request_builder.py Lines 100 to 108 in ae99595
supabase-py/src/utils/src/supabase_utils/http/request.py Lines 36 to 43 in ae99595
supabase-py/src/storage/src/storage3/client.py Lines 56 to 58 in ae99595
supabase-py/src/supabase/src/supabase/lib/client_options.py Lines 78 to 98 in ae99595
supabase-py/src/utils/src/supabase_utils/http/query.py Lines 22 to 26 in ae99595 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
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 kind of change does this PR introduce?
Remove HTTP dependence on
httpx. The idea is to be able to plug in any httpsessionand have the client send it's requests to it, instead of hard coding the calls tohttpx's http session.In order to be completely free from
httpx, it's also needed to introduce alternatives toHeaders,Query,RequestandResponse; so they were created insidesupabase_utils.httpand all references to thesehttpxtypes were refactored.Some tests relied heavily upon the way
httpxstrinfigies theHeadersorQuerytypes (looking at you,postgrest), and so I had to fix them in order to be a little bit less reliant on that.Fixes: #1412.