Skip to content

Commit b0bc72e

Browse files
authored
CI-850: Define method to return generic BytesIO object for DataPortalFile (#177)
* Define method to return generic BytesIO object for DataPortalFile * Fix linting issue by adding extra blank line before class definition * Rename method to read_bytes and move it to be under read method
1 parent 57ca70e commit b0bc72e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cirro/sdk/file.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ def read(self, encoding='utf-8', compression=None) -> str:
174174
) as handle:
175175
return handle.read()
176176

177+
def read_bytes(self) -> BytesIO:
178+
"""Get a generic BytesIO object representing the Data Portal File, to be passed into readers."""
179+
return BytesIO(self._get())
180+
177181
def download(self, download_location: str = None):
178182
"""Download the file to a local directory."""
179183

0 commit comments

Comments
 (0)