Merged
Conversation
icywang86rui
reviewed
Apr 4, 2019
src/sagemaker/predictor.py
Outdated
|
|
||
| def __call__(self, stream, content_type): | ||
| try: | ||
| return list(csv.reader(stream.read().decode('utf-8').splitlines())) |
Contributor
There was a problem hiding this comment.
should we make encoding configurable as well here?
| result = csv_deserializer(io.BytesIO(b'1,2,3\n3,4,5'), 'text/csv') | ||
| assert result == [['1', '2', '3'], ['3', '4', '5']] | ||
|
|
||
|
|
Contributor
There was a problem hiding this comment.
I would add a test with just one line and one value. YMMV
icywang86rui
reviewed
Apr 4, 2019
| class _CsvDeserializer(object): | ||
| def __init__(self): | ||
| self.content_type = CONTENT_TYPE_CSV | ||
| def __init__(self, encoding='utf-8'): |
Contributor
There was a problem hiding this comment.
do you need to pass the accept in as well?
Contributor
Author
There was a problem hiding this comment.
I was staying consistent with:
class _CsvSerializer(object):
def __init__(self):
self.content_type = CONTENT_TYPE_CSVopen to changing it though if there's a compelling use case
icywang86rui
approved these changes
Apr 4, 2019
Contributor
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Contributor
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
mizanfiu
pushed a commit
to mizanfiu/sagemaker-python-sdk
that referenced
this pull request
Dec 13, 2022
This was referenced Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes:
a counterpart to our CSV serializer
Merge Checklist
Put an
xin 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.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.