Skip to content

Commit 65b814b

Browse files
committed
Now returning None from the client method
1 parent 9c51b28 commit 65b814b

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

labelbox/client.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,15 +1687,15 @@ def delete_feature_schema_from_ontology(
16871687
str(response.json()['message']))
16881688

16891689
def unarchive_feature_schema_node(self, ontology_id: str,
1690-
root_feature_schema_id: str) -> bool:
1690+
root_feature_schema_id: str) -> None:
16911691
"""
1692-
Returns true if the root feature schema node was successfully unarchived.
1692+
Unarchives a feature schema node in an ontology.
16931693
Only root level feature schema nodes can be unarchived.
16941694
Args:
1695-
root_feature_schema_id (str): The ID of the root level feature schema
16961695
ontology_id (str): The ID of the ontology
1696+
root_feature_schema_id (str): The ID of the root level feature schema
16971697
Returns:
1698-
bool
1698+
None
16991699
"""
17001700
ontology_endpoint = self.rest_endpoint + "/ontologies/" + urllib.parse.quote(
17011701
ontology_id) + '/feature-schemas/' + urllib.parse.quote(
@@ -1705,11 +1705,9 @@ def unarchive_feature_schema_node(self, ontology_id: str,
17051705
headers=self.headers,
17061706
)
17071707
if response.status_code == requests.codes.ok:
1708-
unarchived = bool(response.json()['unarchived'])
1709-
if (unarchived == False):
1708+
if not bool(response.json()['unarchived']):
17101709
raise labelbox.exceptions.LabelboxError(
1711-
"Failed unarchive the feature schema.")
1712-
return unarchived
1710+
"Failed unarchive the feature schema.")
17131711
else:
17141712
raise labelbox.exceptions.LabelboxError(
17151713
"Failed unarchive the feature schema node, message: ",

tests/integration/test_ontology.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def test_unarchive_feature_schema_node(client, ontology):
251251
feature_schema_to_unarchive = ontology.normalized['tools'][0]
252252
result = client.unarchive_feature_schema_node(
253253
ontology.uid, feature_schema_to_unarchive['featureSchemaId'])
254-
assert result == True
254+
assert result == None
255255

256256

257257
def test_unarchive_feature_schema_node_for_non_existing_feature_schema(

0 commit comments

Comments
 (0)