Skip to content
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

V7 2428 harmonize api for clientpy #287

Merged
merged 28 commits into from
Dec 9, 2021

Conversation

Fl4m3Ph03n1x
Copy link
Contributor

@Fl4m3Ph03n1x Fl4m3Ph03n1x commented Nov 25, 2021

Background

Implementation of changes from RFC:
https://www.notion.so/v7labs/API-Harmonization-for-client-py-0248a627bad144109bf64f078134cecf

This PR focuses on:

  • Usage of Python Logger for debugging instead of print
  • GET PUT POST DELETE functions are now private
  • Created separate functions for RAW
  • No error handlers in all functions
  • Using reponse.ok instead of checking for response.status_code != 200
  • Fixed tests
  • Checked code, no need to return tuples for the time being.

Missing:

  • Add Docs for Sphinx

darwin/client.py Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

darwin/client.py Outdated Show resolved Hide resolved
@Fl4m3Ph03n1x Fl4m3Ph03n1x changed the title [WIP] V7 2428 harmonize api for clientpy V7 2428 harmonize api for clientpy Nov 30, 2021
@Fl4m3Ph03n1x Fl4m3Ph03n1x added the documentation Improvements or additions to documentation label Nov 30, 2021
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment, great work!

darwin/client.py Outdated Show resolved Hide resolved
Copy link
Member

@andreaazzini andreaazzini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested a few changes already, but pretty much:

  • in the new client functions, I would try and be consistent by always returning the response
  • there are some naming conventions I personally don't like (the_{})
  • we are not really introducing any tests for client.py
  • some things feel a bit weird, like using cast or importing logging in all tests. Are we sure there is no other way?

darwin/dataset/upload_manager.py Outdated Show resolved Hide resolved
darwin/client.py Outdated Show resolved Hide resolved
darwin/client.py Outdated Show resolved Hide resolved
darwin/client.py Outdated Show resolved Hide resolved
darwin/dataset/upload_manager.py Outdated Show resolved Hide resolved
darwin/dataset/upload_manager.py Outdated Show resolved Hide resolved
tests/darwin/cli_functions_test.py Show resolved Hide resolved
tests/darwin/client_test.py Show resolved Hide resolved
darwin/client.py Outdated Show resolved Hide resolved
darwin/client.py Outdated
team_slug: str
Team slug of the dataset.
"""
self._put(f"datasets/{dataset_id}/archive", payload={}, team=team_slug)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're probably not using the response when we call archive_remote_dataset, but I would actually return the response for API consistency. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would go even further and actually use a DatasetIdentifier iin every place we are using a slug or an id. However, I think I made enough breaking changes as is for 1 PR :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@andreaazzini andreaazzini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved!

@andreaazzini andreaazzini merged commit 6d933be into master Dec 9, 2021
@andreaazzini andreaazzini deleted the v7-2428-harmonize-api-for-clientpy branch December 9, 2021 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request wind-team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants