-
Notifications
You must be signed in to change notification settings - Fork 923
Promote ex_prefix to top-level storage SDK argument
#1397
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
Conversation
|
Overall, I'm fine with this change, but another option would be to simply name the argument Then we could also have a fallback, if driver doesn't implement Since that method would perform filtering locally, it would probably also be a good idea to document that behavior (perhaps also emit a warning?) to avoid surprises. |
|
@Kami Would promoting |
|
@c-w That's correct, but since it wasn't previously part of the base API, we probably should only update drivers and methods which supported And inside those methods we should probably just do something like In short - I would just like to avoid adding If you won't get a chance to make those changes in the near future, I can also look into it. |
|
Thanks for the additional context @Kami. I'll work on the change and update this PR. |
ex_prefix to be passed via all storage SDK methodsex_prefix to top-level storage SDK argument
Codecov Report
@@ Coverage Diff @@
## trunk #1397 +/- ##
==========================================
+ Coverage 86.57% 86.58% +<.01%
==========================================
Files 364 364
Lines 76209 76224 +15
Branches 7441 7443 +2
==========================================
+ Hits 65981 65996 +15
Misses 7402 7402
Partials 2826 2826
Continue to review full report at Codecov.
|
| metadata = {'object_id': entry['id']} | ||
| yield Object(entry['name'], 0, '', {}, metadata, container, self) | ||
| objects = self._entries_to_objects(container, entries) | ||
| return self._filter_listed_container_objects(objects, prefix) |
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 was thinking about doing this a bit differently, but that approach also works.
We just need to make sure that all the drivers which don't implement custom / server side based filtering call that method.
Kami
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.
Nice work, LGTM 👍
When you get a chance it would also be good to add upgrade notes entry (document this new argument and advise users to migrate from ex_prefix to prefix if they currently use ex_prefix).
|
Added upgrade note in 16c692f. |
Promote
ex_prefixto top-level storage SDK argumentDescription
Most storage drivers implement
ex_prefixforlist_container_objectsanditerate_container_objects. As such, this pull request promotesex_prefixto a top-level argument. For each driver that didn't previously implementex_prefix, a fallback to filter objects client-side is has also been added.Status
Checklist