-
Notifications
You must be signed in to change notification settings - Fork 60
Fix ResourceType._allows_mpack check. #31
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
Current coverage is 47.87% (diff: 27.27%)@@ master #31 diff @@
==========================================
Files 14 14
Lines 1169 1178 +9
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 561 564 +3
- Misses 608 614 +6
Partials 0 0
|
b73e877
to
78952a4
Compare
# path | ||
path = urlpathjoin(path or '') | ||
match = COLLECTIONS_MSGPACK_REGEX.match(path) | ||
if match: |
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.
Maybe it's better to shorten it a bit?
return (match and match.group('key') != 'count)'
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 catch!
Except minor proposal, LGTM 👍 |
78952a4
to
e456071
Compare
Existing check is broken. It works for items, logs and samples only if one uses them through Job object. However it doesn't work correctly for `list(proj.items.apiget('33/5/stats'))`). Also for collections it applies the same rules as for items, but only few collections endpoints support msgpack - scan, batch scan and get collection item. Other endpoints do no support msgpack.
@vshlapakov does it look better now? |
""" | ||
if not MSGPACK_AVAILABLE: | ||
return False | ||
# path |
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.
oops, meaningless comment, fixed in fe134f0
Existing check is broken. It works for items, logs and samples only if one uses them through Job object. However it doesn't work correctly for
list(proj.items.apiget('33/5/stats'))
). Also for collections it applies the same rules as for items, but only few collections endpoints support msgpack - scan, batch scan and get collection item. Other endpoints do no support msgpack.