-
Notifications
You must be signed in to change notification settings - Fork 33
studio-api #63
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
studio-api #63
Conversation
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.
@rodsca @lautarorangil left some comments on the latest PR
We need to be sure that our type-hints for each method are returning the correct types.
I'm seeing a couple of "Dict" instead of "List"
I think it'll be best to follow the google-docs version of the Studio API stuff since it contains examples of what the expected responses should be.
https://docs.google.com/document/d/1q9v4u5uOpvjHZSxv9p49787eqC49DkKZz2QC8A_GjHc/edit
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.
Thanks for those great additions to the SDK! Left some comments.
tests/test_client.py
Outdated
def test_list_teammates(): | ||
client.list_teammates() | ||
|
||
|
||
def test_invite_teammates(): | ||
client.invite_teammates( | ||
[f"test+{current_timestamp}@scale.com"], TeammateRole.Member | ||
) | ||
|
||
|
||
def test_list_assignments(): | ||
client.list_studio_assignments() | ||
|
||
|
||
def test_list_studio_batches(): | ||
client.list_studio_batches() |
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.
can those list
tests assure something, other than just calling the endpoint?
i.e. there are some test cases it creates some data first, then tests if it pulls them correctly
scaleapi-python-client/tests/test_client.py
Lines 406 to 423 in 5fd9adb
def test_batches(): | |
batches = [] | |
for _ in range(3): | |
batches.append(create_a_batch()) | |
batch_names = {batch.name for batch in batches} | |
for batch in client.batches(limit=3): | |
assert batch.name in batch_names | |
def test_get_batches(): | |
# Get count of all batches | |
batchlist = client.batches(project=TEST_PROJECT_NAME, limit=1) | |
total_batches = batchlist.total | |
# Download all batches to check total count | |
all_batches = list(client.get_batches(project_name=TEST_PROJECT_NAME)) | |
assert total_batches == len(all_batches) |
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.
Yeah that'll definitely be better.
current_timestamp = str(uuid.uuid4)[-9:] | ||
|
||
|
||
def test_list_teammates(): |
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.
@lautarorangil can you add a couple of teammates, and compare the lens to create some tests
Pull Request Summary
Description
Studio API endpoints
TODO BEFORE MERGE:
How did you test your code?
included a t_studio.py file since Studio endpoints require live projects
Checklist
Please make sure all items in this checklist have been fulfilled before sending your PR out for review!
_version.py
(unless this PR only updates the documentation).