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

APILIB-20: Update python-api library to support query parameters for endpoints #8

Open
wants to merge 2 commits into
base: master
from

Conversation

@gruberrro
Copy link

@gruberrro gruberrro commented Aug 17, 2020

Possibly there should be a way to pass a query parameters to all requests.

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

This comment has been minimized.

@gruberrro

gruberrro Aug 17, 2020
Author

I'm not sure if it good approach...

This comment has been minimized.

@akszydelko

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.

This comment has been minimized.

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

This comment has been minimized.

@gruberrro

gruberrro Aug 17, 2020
Author

Either this or this?

This comment has been minimized.

@akszydelko

akszydelko Aug 19, 2020
Contributor

Same here params = kwargs.pop('params', {})

This comment has been minimized.

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

This comment has been minimized.

@akszydelko

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.

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

This comment has been minimized.

@akszydelko

akszydelko Aug 19, 2020
Contributor

Same here params = kwargs.pop('params', {})

@gruberrro gruberrro requested a review from akszydelko Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.