Skip to content

Conversation

@lgluszek
Copy link
Contributor

@lgluszek lgluszek commented Feb 27, 2023

https://labelbox.atlassian.net/browse/PTDT-1109
https://labelbox.atlassian.net/browse/PTDT-1110
https://labelbox.atlassian.net/browse/PTDT-1112
https://labelbox.atlassian.net/browse/PTDT-1113
https://labelbox.atlassian.net/browse/PTDT-1131
https://labelbox.atlassian.net/browse/PTDT-1132

Introduced 7 new methods:

client.delete_unused_feature_schema("cleieor3u000ewsvu614pb218")
client.delete_unused_ontology("cleieor3u000ewsvu614pb218")
tool = Tool(
    tool=Tool.Type.POINT,
    name="entity 10",
    color="#ff0000",
)
client.upsert_feature_schema(tool.asdict())
client.update_feature_schema_title(
    feature_schema_id="clelns1my012ioqvu5anyanya",
    title="entity 123",
)
client.insert_feature_schema_into_ontology(
    feature_schema_id="cleiepqtg000gwsvuhzq8cu6x",
    ontology_id="cleh224kc0013rwvua1cxenh1",
    position=3
)
client.get_unused_ontologies()
client.get_unused_ontologies("cleh224kc0013rwvua1cxenh1")
client.get_feature_schemas()
client.get_eature_schemas("cleiepqtg000gwsvuhzq8cu6x")

@lgluszek lgluszek self-assigned this Feb 27, 2023
@lgluszek lgluszek changed the title add methods to manage feature schemas [PTDT-1109][PTDT-1110][PTDT-1112][PTDT-1113] Manage feature schemas Feb 27, 2023
)


def test_deletes_a_feature_schema(client):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Decided to not use fixtures for tests, because the feature schema class does not have a "deletable" interface. Schema nodes have a "deleted" property, but we can't create such fixtures.

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.

Looks a lot better! Thanks for adding all of the tests too.

Left one comment, and also, it'd be great if you could add return types for functions. For "delete" functions, you can add None as return type.

Also, the build is failing. Could you try rebasing the latest develop branch and try the build again? There were some recent fixes to export related tests, and I wonder if your branch is stale

"Failed to update the feature schema, message: " +
str(response.json()['message']))

def upsert_feature_schema(self, normalized: Dict):
Copy link
Contributor

Choose a reason for hiding this comment

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

  • Could you name it something more descriptive than normalized? I think what you had before was fine: feature_schema. Now it's more obvious what type of data is needed, with the type hint. Let's also add a description of what this dictionary should be, in the docstring:
feature_schema: Dict representing the feature schema to upsert

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, here are the changes 56583b5

@lgluszek lgluszek changed the title [PTDT-1109][PTDT-1110][PTDT-1112][PTDT-1113] Manage feature schemas New methods to manage feature schemas and ontologies Feb 28, 2023
"Failed to delete the ontology, message: " +
str(response.json()['message']))

def update_feature_schema_title(self, feature_schema_id: str, title: str):
Copy link
Contributor

Choose a reason for hiding this comment

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

Return type here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"Failed to update the feature schema, message: " +
str(response.json()['message']))

def upsert_feature_schema(self, feature_schema: Dict):
Copy link
Contributor

Choose a reason for hiding this comment

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

Return type here?

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
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.

LGTM!

@lgluszek lgluszek merged commit 5a796da into develop Mar 1, 2023
@lgluszek lgluszek deleted the lgluszek/ontology-update branch March 1, 2023 18:16
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.

3 participants