-
-
Notifications
You must be signed in to change notification settings - Fork 65
feat: allow injection of httpx client #591
Conversation
Pull Request Test Coverage Report for Build 15650813752Details
💛 - Coveralls |
postgrest/_async/client.py
Outdated
| ) -> AsyncClient: | ||
| if http_client is not None: | ||
| http_client.base_url = base_url | ||
| http_client.headers = headers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should also pass timeout, verify, proxy, here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't pass those as I don't want them to be override the options for httpx client the developer will pass. The only options we need to maintain are the base_url and headers. The others should be manually configured by the developer if they are passing their own httpx client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, let us at least deprecate the usage of the other params in favor of the httpx client as in https://github.com/supabase/functions-py/pull/201/files#r2083278694
|
@silentworks can you add at least one test case that uses a custom httpx instance? |
6b027b9 to
4506be3
Compare
What kind of change does this PR introduce?
Allow developers to supply their own httpx client
What is the current behavior?
Httpx client isn't very configurable and has limited options available for the developer
What is the new behavior?
Httpx client can now be configured by the developer and be supplied to the Postgrest library
Additional context
Add any other context or screenshots.