-
Notifications
You must be signed in to change notification settings - Fork 68
[PTDT-1106] Implemented delete_feature_schema_from_ontology client method #958
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
kkim-labelbox
left a comment
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.
The code looks good.
- Left a couple nit comments
- Could you add a test case for this endpoint? You can probably reference @lgluszek 's tests
labelbox/client.py
Outdated
| elif response_json['deleted'] == True: | ||
| logger.info( | ||
| 'Feature schema was successfully removed from the ontology') | ||
| return response_json |
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 we actually create an instance of DeleteFeatureFromOntologyResult as the return object, rather than returning response_json directly? This will ensure we have consistent typing and prevent API changes from breaking customer scripts, if there's additional fields added to the response json.
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.
NOTE: In order to properly test this PR locally you need to pull down the PTDT-1106 Intelligence branch. This branch contains the endpoint referenced in this PR.
Created new client method:
remove_feature_schema_from_ontology(ontology_id, feature_schema_id)This method removes (or archives) a feature schema from an ontology.
How to test:
If successful prints a success message. If not successful prints the error response from the api.