Skip to content

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

Merged
merged 34 commits into from
Dec 14, 2022
Merged

studio-api #63

merged 34 commits into from
Dec 14, 2022

Conversation

jonathanfeng-scale
Copy link
Contributor

@jonathanfeng-scale jonathanfeng-scale commented Nov 22, 2022

Pull Request Summary

Description

Studio API endpoints

TODO BEFORE MERGE:

  • still need to update public readme
  • look into deploy checklist
  • increment sdk version
  • Release summary pre-write

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!

  • I have commented my code in details, particularly in hard-to-understand areas
  • I have updated Readme.rst document with examples for newly implemented public methods
  • I have reviewed Deployment and Publishing Guide for Python SDK document
  • I incremented the SDK version in _version.py (unless this PR only updates the documentation).
  • In order to release a new version, a "Release Summary" needs to be prepared and published after the merge

Copy link
Contributor Author

@jonathanfeng-scale jonathanfeng-scale left a 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

@jonathanfeng-scale jonathanfeng-scale marked this pull request as ready for review December 6, 2022 08:14
@jonathanfeng-scale jonathanfeng-scale changed the title starter studio-api Dec 8, 2022
Copy link
Contributor

@fatihkurtoglu fatihkurtoglu left a 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.

Comment on lines 444 to 459
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()
Copy link
Contributor

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

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)

Copy link
Contributor Author

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.

jonathanfeng-scale and others added 7 commits December 7, 2022 21:19
Co-authored-by: Fatih Kurtoglu <fatih.kurtoglu@scale.com>
Co-authored-by: Fatih Kurtoglu <fatih.kurtoglu@scale.com>
Co-authored-by: Fatih Kurtoglu <fatih.kurtoglu@scale.com>
@fatihkurtoglu fatihkurtoglu mentioned this pull request Dec 10, 2022
7 tasks
current_timestamp = str(uuid.uuid4)[-9:]


def test_list_teammates():
Copy link
Contributor Author

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

@jonathanfeng-scale jonathanfeng-scale merged commit 6a0dbc4 into master Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants