-
Notifications
You must be signed in to change notification settings - Fork 1
Added cloud storage utility to toolkit #19
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: master
Are you sure you want to change the base?
Conversation
47d571a to
22fd201
Compare
anandology
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.
There are some features like copying a directory, downloading a whole directory etc. present in the storage.py of algoshelf/maverix that are not available here. It would be good to add them here.
Also, can you please test cases?
toolkit/storage.py
Outdated
| collection = bucket.objects.filter(Prefix=self.path) | ||
| return [obj.key for obj in collection.all()] | ||
|
|
||
| def read_dataframe(self): |
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.
I guess it is better have separate read_csv and read_paquet methods.
toolkit/storage.py
Outdated
| return False | ||
| raise | ||
|
|
||
| def delete(self, del_dir: bool=False): |
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.
The del_dir doesn't sound right. See what is used in pathlib for this kind of operation.
| """Read the contents of a path | ||
| """ | ||
| obj = self._object | ||
| return obj.get()['Body'].read() |
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.
If there is a read_text, then there should be a read_bytes as well. What about write? Shouldn't we have write_text and write_bytes methods?
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.
Also. i guess, [Body].read() returns bytes, not text. Please check.
22fd201 to
1397967
Compare
|
@anandology , It is still needs a proper testing, test cases and exception handling, I am on it currently. Meanwhile you can have a look at it and please pass your comments. |
8c917db to
0f6e99f
Compare
anandology
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.
LGTM!
1e59f1e to
c02c02d
Compare
78692a6 to
85b0858
Compare
85b0858 to
d60c137
Compare
closes #18