Skip to content

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

Merged
merged 1 commit into from
Oct 18, 2016
Merged

Conversation

chekunkov
Copy link
Contributor

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.

@codecov-io
Copy link

codecov-io commented Oct 18, 2016

Current coverage is 47.87% (diff: 27.27%)

Merging #31 into master will decrease coverage by 0.11%

@@             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          

Powered by Codecov. Last update ec71641...e456071

# path
path = urlpathjoin(path or '')
match = COLLECTIONS_MSGPACK_REGEX.match(path)
if match:
Copy link
Contributor

@vshlapakov vshlapakov Oct 18, 2016

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)'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@vshlapakov
Copy link
Contributor

Except minor proposal, LGTM 👍

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.
@chekunkov
Copy link
Contributor Author

@vshlapakov does it look better now?

@vshlapakov vshlapakov merged commit 849f9f2 into master Oct 18, 2016
@vshlapakov vshlapakov deleted the fix-allows-mpack branch October 18, 2016 14:07
"""
if not MSGPACK_AVAILABLE:
return False
# path
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants