Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAPILIB-20: Update python-api library to support query parameters for endpoints #8
Conversation
infermedica_api/webservice.py
Outdated
| @@ -182,11 +182,11 @@ def search(self, phrase, sex=None, max_results=8, filters=None, **kwargs): | |||
| :rtype: list | |||
| """ | |||
| method = self.__get_method('search') | |||
| params = { | |||
| params = kwargs.pop('params', kwargs) | |||
gruberrro
Aug 17, 2020
Author
I'm not sure if it good approach...
I'm not sure if it good approach...
akszydelko
Aug 19, 2020
Contributor
Imo no, we don't know what will be put to kwargs. params = kwargs.pop('params', {}) should be the way to go.
Imo no, we don't know what will be put to kwargs. params = kwargs.pop('params', {}) should be the way to go.
infermedica_api/webservice.py
Outdated
| @@ -238,14 +238,21 @@ def suggest(self, diagnosis_request, max_results=8, interview_id=None): | |||
| """ | |||
| method = self.__get_method('suggest') | |||
| headers = self.__get_interview_id_headers(interview_id=interview_id) | |||
| params = kwargs | |||
akszydelko
Aug 19, 2020
Contributor
Same here params = kwargs.pop('params', {})
Same here params = kwargs.pop('params', {})
infermedica_api/webservice.py
Outdated
| @@ -182,11 +182,11 @@ def search(self, phrase, sex=None, max_results=8, filters=None, **kwargs): | |||
| :rtype: list | |||
| """ | |||
| method = self.__get_method('search') | |||
| params = { | |||
| params = kwargs.pop('params', kwargs) | |||
akszydelko
Aug 19, 2020
Contributor
Imo no, we don't know what will be put to kwargs. params = kwargs.pop('params', {}) should be the way to go.
Imo no, we don't know what will be put to kwargs. params = kwargs.pop('params', {}) should be the way to go.
infermedica_api/webservice.py
Outdated
| @@ -238,14 +238,21 @@ def suggest(self, diagnosis_request, max_results=8, interview_id=None): | |||
| """ | |||
| method = self.__get_method('suggest') | |||
| headers = self.__get_interview_id_headers(interview_id=interview_id) | |||
| params = kwargs | |||
akszydelko
Aug 19, 2020
Contributor
Same here params = kwargs.pop('params', {})
Same here params = kwargs.pop('params', {})
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.
Possibly there should be a way to pass a query parameters to all requests.