Skip to content

Conversation

@Tim-Kerr
Copy link
Contributor

@Tim-Kerr Tim-Kerr commented Mar 1, 2023

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:

from labelbox import Client

client = Client(
    api_key=<api_key>,
    rest_endpoint="http://localhost:3000/api/api/v1")

res = client.delete_feature_schema_from_ontology(<ontology_id>, <feature_schema_id>)

If successful prints a success message. If not successful prints the error response from the api.

Copy link
Contributor

@kkim-labelbox kkim-labelbox left a 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

elif response_json['deleted'] == True:
logger.info(
'Feature schema was successfully removed from the ontology')
return response_json
Copy link
Contributor

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.

Copy link
Contributor Author

@Tim-Kerr Tim-Kerr Mar 6, 2023

Choose a reason for hiding this comment

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

@Tim-Kerr Tim-Kerr changed the title [PTDT-1106] Implemented remove_feature_schema_from_ontology client method [PTDT-1106] Implemented delete_feature_schema_from_ontology client method Mar 7, 2023
@Tim-Kerr Tim-Kerr merged commit 5af2944 into develop Mar 8, 2023
@Tim-Kerr Tim-Kerr deleted the PTDT-1106 branch March 8, 2023 18:56
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