-
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: ei-3539 - Update the SDK to handle the allow_upload flag in list connections #44
feat: ei-3539 - Update the SDK to handle the allow_upload flag in list connections #44
Conversation
5b7c858
to
a182dff
Compare
6b7ee4a
to
0ec97a3
Compare
nyx_client/nyx_client/client.py
Outdated
Returns: | ||
A list of `Connection` objects | ||
|
||
Raises: | ||
requests.HTTPError: if the API request fails. | ||
""" | ||
connections = self._nyx_get(NYX_CONNECTIONS_ENDPOINT) | ||
params = dict(allow_upload=allow_upload) if allow_upload is not None else None |
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.
Typically (at least in this repo) we don't instantiate dictionarties using the class syntax but instead do e.g.:
{"allow_upload": allow_upload}
.
(It also makes a small perf difference but that's irrelevant here.)
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.
Done.
@@ -937,14 +937,19 @@ def delete_circle(self, circle: Circle): | |||
""" | |||
self.delete_circle_by_name(circle.name) | |||
|
|||
def get_connections(self) -> list[Connection]: | |||
def get_connections(self, allow_upload: bool | None = None) -> list[Connection]: |
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.
If there were a test already for get_connections
, I'd say to to add parametrized one to show that this option is passed through. However I see on main we don't have any yet.
0ec97a3
to
f3e0f65
Compare
"""Lists all connections. | ||
|
||
Args: | ||
allow_upload: Filter the connections by allow_upload, defaults to show all. |
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.
I'd say the only thing is it might be clear to uses that there are three options here:
None
- allallow_upload=True
just with upload enabled (write)allow_upload=False
just with upload disabled (read-only)
But maybe it doesn't matter.
Update the SDK to handle the allow_upload flag in list connections