-
-
Notifications
You must be signed in to change notification settings - Fork 381
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 version_id transport parameter for fetching a specific S3 object version #325
Conversation
Added check for the existence of the passed id.
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.
Good start, please see my comments and add some thorough unit tests.
smart_open/s3.py
Outdated
@@ -112,6 +114,7 @@ def open( | |||
fileobj = SeekableBufferedInputBase( | |||
bucket_id, | |||
key_id, | |||
version_id, |
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.
Pass keyword parameters by name.
version_id, | |
version_id=version_id, |
1. Updated help revision_id; 2. Added version validation when getting the length of an object s3 in BufferedInputBase; 3. Style adjustment.
….ClientError - creates an exception IOerror
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.
Still needs tests
This test checks the correctness of reading object s3 by version and calling an exception if the object version is incorrect.
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.
Nice progress. Left you some more comments, please take a look.
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.
Let you some more comments.
Also, you're missing a top-level test. You should make sure that working with your version_id parameter via the top-level smart_open.open function works as intended.
Finally, it looks like the documentation isn't picking up your new parameter. It should appear here but does not.
Also, looks like unit tests are failing, please fix:
|
… the version is not None. Added test for this.
# Conflicts: # smart_open/tests/test_s3_version.py
- changed the name of the object in the use case version_id; - pep8
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.
OK, this is ready to merge
@interpolatio Congrats on your very first contribution to smart_open! 🥇 Keep them coming! |
Added file check by id.
Added check for the existence of the passed id.
Fix #306