Skip to content
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

Option to return proto OR dict for SeldonClient methods #1175

Merged
merged 5 commits into from
Dec 5, 2019

Conversation

axsaucedo
Copy link
Contributor

Added functionality to specify proto return type or json return type for Seldon Client functions

Fixes #1083

@seldondev seldondev added size/L and removed size/M labels Dec 2, 2019
@axsaucedo axsaucedo changed the title WIP: Option to return proto OR dict for SeldonClient methods Option to return proto OR dict for SeldonClient methods Dec 2, 2019
@axsaucedo
Copy link
Contributor Author

/cc @cliveseldon @adriangonz

Copy link
Contributor

@adriangonz adriangonz left a comment

Choose a reason for hiding this comment

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

Besides the small comment (where it may not even be necessary to change anything), I think it looks good!

As an aside, something out of the scope of this PR, I think that SeldonClient may have too many parameters now? I'm not sure if this is the case, and even if it is, I'm not sure if it would even be an issue.

assert "jsonData" in mock_post.call_args[1]["json"]
assert mock_post.call_args[1]["json"]["jsonData"] == JSON_TEST_DATA
assert response.success is True
assert json_response["jsonData"] == JSON_TEST_DATA
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps it would be good to add an assertion here for having a dict type? I think something like this should work:

assert isinstance(json_response, dict)

Similarly, we could add assertions on the existing tests for SeldonMessage?

PS: I just realised that the SeldonMessage ones use seldon_message_to_json(...) so perhaps this is not necessary.

@adriangonz
Copy link
Contributor

/approve

@seldondev
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adriangonz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@seldondev seldondev merged commit 74c6fe5 into SeldonIO:master Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent return value for explain method in SeldonClient
3 participants