Skip to content

Bug fix: https://github.com/aws/sagemaker-python-sdk/issues/123 #294

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 12 commits into from
Jul 26, 2018

Conversation

mvsusp
Copy link
Contributor

@mvsusp mvsusp commented Jul 16, 2018

Issue #, if available:
Bug fix for #123

Description of changes:

  • added test to reproduce issue
  • parsing response from TF serving

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have updated the changelog with a description of my changes (if appropriate)
  • I have updated any necessary documentation (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

setup.py Outdated
@@ -49,7 +49,7 @@ def read(fname):

extras_require={
'test': ['tox', 'flake8', 'pytest', 'pytest-cov', 'pytest-xdist',
'mock', 'tensorflow>=1.3.0', 'contextlib2', 'awslogs', 'pandas']},
'mock', 'tensorflow>=1.3.0', 'protobuf3-to-dict', 'contextlib2', 'awslogs', 'pandas']},
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you move protobuf3-to-dict to install_requires (and add a version)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thank you.


for possible_response in _POSSIBLE_RESPONSES:
try:
return protobuf_to_dict(json_format.Parse(data, possible_response()))
Copy link
Contributor

@andremoeller andremoeller Jul 16, 2018

Choose a reason for hiding this comment

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

Would google.protobuf.json_format.MessageToDict (with json.loads) be suitable here?

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 call!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually tried and won't work. google.protobuf.json_format.MessageToDict serializes the values again, which is the bug behavior that we won't to avoid.

andremoeller
andremoeller previously approved these changes Jul 17, 2018
andremoeller
andremoeller previously approved these changes Jul 20, 2018
@codecov-io
Copy link

codecov-io commented Jul 23, 2018

Codecov Report

Merging #294 into master will decrease coverage by 0.02%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #294      +/-   ##
==========================================
- Coverage   92.94%   92.92%   -0.03%     
==========================================
  Files          50       50              
  Lines        3472     3475       +3     
==========================================
+ Hits         3227     3229       +2     
- Misses        245      246       +1
Impacted Files Coverage Δ
src/sagemaker/tensorflow/predictor.py 95.83% <88.88%> (-1.27%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eb5099c...9033af9. Read the comment docs.

@mvsusp mvsusp merged commit 6638474 into aws:master Jul 26, 2018
@mvsusp mvsusp deleted the mvs-prediction-fix branch July 26, 2018 19:04
knakad added a commit to knakad/sagemaker-python-sdk that referenced this pull request Dec 4, 2019
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