Skip to content

Commit f216e1c

Browse files
authored
Stream response for reading files via pyodide (#154)
* Stream response for reading files via pyodide * Bump version
1 parent 7550d42 commit f216e1c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

cirro/helpers/pyodide_patch_file.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ def _get_file_from_path(self: FileService, access_context: FileAccessContext, fi
3030
)
3131

3232
# Make the request
33-
response = requests.get(endpoint, auth=auth)
33+
response = requests.get(endpoint, auth=auth, stream=True)
3434

3535
# Raise an error if the exit code is not 400
3636
response.raise_for_status()
3737

38+
# Read the content of the response and decode it
39+
content = response.raw.read(decode_content=True)
40+
3841
# Return the contents of the response
39-
return response.content
42+
return content
4043

4144

4245
def pyodide_patch_file():

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "cirro"
3-
version = "1.5.3"
3+
version = "1.5.4"
44
description = "CLI tool and SDK for interacting with the Cirro platform"
55
authors = ["Cirro Bio <[email protected]>"]
66
license = "MIT"

0 commit comments

Comments
 (0)