-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feat iaso connection nf #23
Conversation
2da8763
to
883d95a
Compare
….Session and avoid reading env vars
ed9e772
to
3ae2c11
Compare
3ae2c11
to
7f5dd00
Compare
4af6343
to
765076c
Compare
b53e721
to
bc414f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you document your classes & methods please?
d779f71
to
460a147
Compare
25fa62e
to
b6be97c
Compare
…ntiation in IASO module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there !
openhexa/toolbox/iaso/iaso.py
Outdated
raise ValueError("Values for org_units and projects cannot be empty lists") | ||
params = kwargs | ||
params.update({"page": page, "limit": limit, "org_units": org_units, "projects": projects}) | ||
response = self.api_client.request("POST", "/api/forms", data=params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the methods are available on the Session object.
response = self.api_client.request("POST", "/api/forms", data=params) | |
response = self.api_client.post("/api/forms", data=params) |
openhexa/toolbox/iaso/iaso.py
Outdated
params.update({"page": page, "limit": limit}) | ||
if as_dataframe: | ||
params.update({"csv": "true"}) | ||
response = self.api_client.request("GET", "/api/instances", params=params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response = self.api_client.request("GET", "/api/instances", params=params) | |
response = self.api_client.get("/api/instances", params=params) |
openhexa/toolbox/iaso/iaso.py
Outdated
response = self.api_client.request("GET", "/api/instances", params=params) | ||
forms = pl.read_csv(io.StringIO(response.content.decode("utf-8")))[dataframe_columns] | ||
return forms | ||
response = self.api_client.request("GET", "/api/instances/", params=kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response = self.api_client.request("GET", "/api/instances/", params=kwargs) | |
response = self.api_client.get("/api/instances/", params=kwargs) |
openhexa/toolbox/iaso/iaso.py
Outdated
""" | ||
params = kwargs | ||
params.update({"page": page, "limit": limit}) | ||
response = self.api_client.request("GET", "/api/orgunits", params=kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response = self.api_client.request("GET", "/api/orgunits", params=kwargs) | |
response = self.api_client.get("/api/orgunits", params=params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params=kwargs
works since you just copy the reference into params
and update the dictionary in-place (and thus the kwargs object) but I would prefer to update the kwargs directly OR using params here.
openhexa/toolbox/iaso/iaso.py
Outdated
|
||
params = kwargs | ||
params.update({"page": page, "limit": limit}) | ||
response = self.api_client.request("GET", "/api/projects", params=params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response = self.api_client.request("GET", "/api/projects", params=params) | |
response = self.api_client.get("/api/projects", params=params) |
eb9a855
to
33d405d
Compare
33d405d
to
f9405ac
Compare
Creates IASO API client as module to fetch
https://bluesquare.atlassian.net/jira/software/c/projects/HEXA/boards/330?selectedIssue=HEXA-963