-
Notifications
You must be signed in to change notification settings - Fork 33
Add API V2 support #97
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
Conversation
413a757
to
cbdcba5
Compare
@@ -17,11 +17,11 @@ jobs: | |||
- run: | |||
name: Black Formatting Check # Only validation, without re-formatting | |||
command: | | |||
black --check -t py36 . | |||
black --check --exclude 'scaleapi/api_client/*' -t py38 . |
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.
is there a way to run it through black after we generate. We run the typescript one through prettier
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.
not a big deal if it's not easy
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 there's also some others in the precommit, can try to do something similar next time
@@ -318,6 +330,83 @@ def tasks(self, **kwargs) -> Tasklist: | |||
response.get("next_token"), | |||
) | |||
|
|||
def v2_get_tasks( |
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.
so you can do like:
client = ScaleClient()
client.v2_get_tasks(...)
client.v2.get_tasks(...)
right?
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.
yes, where v2.
exposes the auto-generated and v2_get_tasks
is to match existing get_tasks
pagination
Pull Request Summary
Description
Please include a summary of the changes. Please also include the relevant context and motivation. List any dependencies and assumptions that are required for this change.
Added client for V2 endpoints and utility function
v2_get_tasks
. Updated requirements and python version to >=3.8 to support the new client.How did you test your code?
Which of the following have you done to test your changes? Please describe the tests that you ran to verify your changes.
tests/
for the newly implemented methodstests/
to cover changes made to existing methodsAdded tests for
v2_get_tasks
andv2.get_task
- leaving commented until they can pass for other users.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).