-
Notifications
You must be signed in to change notification settings - Fork 499
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
Add more file-like methods to the python bindings #4384
Add more file-like methods to the python bindings #4384
Conversation
This partially addresses #4384. It assumes that all readable services support seeking, which may not be valid, but it mirrors the implementation |
…hub.com/mobiusklein/opendal into feature/python_io_more_filelike_methods
Can you use https://docs.rs/opendal/latest/opendal/struct.Capability.html#structfield.read_can_seek? |
This is an ongoing RFC related to this: #4382 |
I've added the capability check to the Python bindings, but is there anything specific I should do w.r.t. the RFC? Or is it just a blocker for this PR? |
After this RFC been implemented (which is already going on), we might need to change the way of implement |
Hi, @mobiusklein, sorry for the long waiting. I feel like this PR is good to go. Would you like to fix the CI issues so we can get it merged? |
Is it correct to say that |
Yes! |
Thank you. I've refactored the bindings to reflect that. The |
Things appear to be all set now. Thank you. |
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.
Thanks a lot!
This adds the following methods to the
File
type in the Python bindings:flush
readable
writable
seekable
closed
readinto
For
AsyncFile
, the following were added:readable
writable
seekable
closed
Manually testing was done locally, but I couldn't get the unit tests to run due to environment dependency issues. Hopefully CI will trigger here.