-
Notifications
You must be signed in to change notification settings - Fork 981
feat(python-sdk): move the volume content client onto pyqwest #1602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
01a61af
feat(python-sdk): move volume content client onto pyqwest
mishushakov e6e9614
feat(python-sdk): bound volume streams with a 60s idle read timeout o…
mishushakov 5ca2c5d
feat(python-sdk): honor stream_idle_timeout per read in AsyncVolume.r…
mishushakov 77972cb
refactor(python-sdk): point the volume config at the owned ProxyTypes…
mishushakov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| "@e2b/python-sdk": minor | ||
| --- | ||
|
|
||
| Move the volume content client (`Volume`/`AsyncVolume` file operations) onto | ||
| [`pyqwest`](https://pypi.org/project/pyqwest/) via its httpx-compatible | ||
| transport adapter, the same stack the REST API client uses. The connection | ||
| pool is shared process-wide per proxy instead of one pool per thread (sync) | ||
| or per event loop (async), and connection-establishment failures are retried | ||
| with backoff (`E2B_CONNECTION_RETRIES`, default 3), as before. | ||
|
|
||
| For streamed volume reads (`Volume.read_file(format="stream")`), a stalled | ||
| stream is by default bounded by a transport-wide idle read timeout of | ||
| 60 seconds that resets on every chunk (still surfaced as | ||
| `httpx.ReadTimeout`; matches the JS SDK's default stream idle timeout). | ||
| `AsyncVolume.read_file` keeps honoring an explicit `stream_idle_timeout` | ||
| per read (including `0` to disable); the sync client ignores it — it cannot | ||
| interrupt a blocking read. Passing `request_timeout` to a streamed read now | ||
| bounds the whole transfer rather than individual socket operations. |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
When async volume calls receive a 3xx, this
HTTPTransportnow follows it inside pyqwest before the generatedhttpx.AsyncClient(follow_redirects=False)and the SDK's status/error handling can observe the redirect. Pyqwest's async transport defaults to following redirects and its docs advise disabling that when used through the HTTPX adapter (reference), so async volume operations can now turn redirects into unrelated downstream responses instead of preserving the established no-redirect behavior. Please passfollow_redirects=Falsehere.Useful? React with 👍 / 👎.