-
Notifications
You must be signed in to change notification settings - Fork 8
Added methods and test cases for OpendalBufferedFile #27
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
base: main
Are you sure you want to change the base?
Conversation
|
Hi @Xuanwo, could you please take a look when you get a chance and share your feedback? |
Xuanwo
left a comment
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.
Thank you for working on this!
| def _fetch_range(self, start: int, end: int) -> bytes: | ||
| """Download data between start and end.""" | ||
| logger.debug(f"Fetching bytes from {start} to {end} for {self.path}") | ||
| data = self.fs.fs.read(self.path) # sync operator |
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.
We now have native support for read(self.path, offset, size) after apache/opendal#6086 was merged. Would you like to create an issue to track this, so we can update our usage and avoid reading the entire file?
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.
#28 Created the issue
| def _commit_upload(self) -> None: | ||
| """Ensure upload is complete""" | ||
| pass | ||
| """Write the full buffer to the backend once""" |
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.
OpenDAL has it's own buffer, so we just need to implement write for OpendalBufferedFile.
Which issue is this PR linked to?
This PR is in continuation of the discussion [#24].
What changes are included in this PR?
Support for the below methods:
Added test cases
Minor fixes to linting