Skip to content

Commit 254fae3

Browse files
author
Val Brodsky
committed
PR feedback
1 parent 791817a commit 254fae3

File tree

1 file changed

+10
-24
lines changed

1 file changed

+10
-24
lines changed

libs/labelbox/src/labelbox/client.py

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ def delete_unused_feature_schema(self, feature_schema_id: str) -> None:
12131213

12141214
endpoint = self.rest_endpoint + "/feature-schemas/" + urllib.parse.quote(
12151215
feature_schema_id)
1216-
response = self._connection.delete(endpoint,)
1216+
response = self._connection.delete(endpoint)
12171217

12181218
if response.status_code != requests.codes.no_content:
12191219
raise labelbox.exceptions.LabelboxError(
@@ -1230,7 +1230,7 @@ def delete_unused_ontology(self, ontology_id: str) -> None:
12301230
"""
12311231
endpoint = self.rest_endpoint + "/ontologies/" + urllib.parse.quote(
12321232
ontology_id)
1233-
response = self._connection.delete(endpoint,)
1233+
response = self._connection.delete(endpoint)
12341234

12351235
if response.status_code != requests.codes.no_content:
12361236
raise labelbox.exceptions.LabelboxError(
@@ -1252,10 +1252,7 @@ def update_feature_schema_title(self, feature_schema_id: str,
12521252

12531253
endpoint = self.rest_endpoint + "/feature-schemas/" + urllib.parse.quote(
12541254
feature_schema_id) + '/definition'
1255-
response = self._connection.patch(
1256-
endpoint,
1257-
json={"title": title},
1258-
)
1255+
response = self._connection.patch(endpoint, json={"title": title})
12591256

12601257
if response.status_code == requests.codes.ok:
12611258
return self.get_feature_schema(feature_schema_id)
@@ -1285,9 +1282,7 @@ def upsert_feature_schema(self, feature_schema: Dict) -> FeatureSchema:
12851282
endpoint = self.rest_endpoint + "/feature-schemas/" + urllib.parse.quote(
12861283
feature_schema_id)
12871284
response = self._connection.put(
1288-
endpoint,
1289-
json={"normalized": json.dumps(feature_schema)},
1290-
)
1285+
endpoint, json={"normalized": json.dumps(feature_schema)})
12911286

12921287
if response.status_code == requests.codes.ok:
12931288
return self.get_feature_schema(response.json()['schemaId'])
@@ -1313,10 +1308,7 @@ def insert_feature_schema_into_ontology(self, feature_schema_id: str,
13131308
endpoint = self.rest_endpoint + '/ontologies/' + urllib.parse.quote(
13141309
ontology_id) + "/feature-schemas/" + urllib.parse.quote(
13151310
feature_schema_id)
1316-
response = self._connection.post(
1317-
endpoint,
1318-
json={"position": position},
1319-
)
1311+
response = self._connection.post(endpoint, json={"position": position})
13201312
if response.status_code != requests.codes.created:
13211313
raise labelbox.exceptions.LabelboxError(
13221314
"Failed to insert the feature schema into the ontology, message: "
@@ -1337,10 +1329,7 @@ def get_unused_ontologies(self, after: str = None) -> List[str]:
13371329
"""
13381330

13391331
endpoint = self.rest_endpoint + "/ontologies/unused"
1340-
response = self._connection.get(
1341-
endpoint,
1342-
json={"after": after},
1343-
)
1332+
response = self._connection.get(endpoint, json={"after": after})
13441333

13451334
if response.status_code == requests.codes.ok:
13461335
return response.json()
@@ -1364,10 +1353,7 @@ def get_unused_feature_schemas(self, after: str = None) -> List[str]:
13641353
"""
13651354

13661355
endpoint = self.rest_endpoint + "/feature-schemas/unused"
1367-
response = self._connection.get(
1368-
endpoint,
1369-
json={"after": after},
1370-
)
1356+
response = self._connection.get(endpoint, json={"after": after})
13711357

13721358
if response.status_code == requests.codes.ok:
13731359
return response.json()
@@ -1888,7 +1874,7 @@ def is_feature_schema_archived(self, ontology_id: str,
18881874

18891875
ontology_endpoint = self.rest_endpoint + "/ontologies/" + urllib.parse.quote(
18901876
ontology_id)
1891-
response = self._connection.get(ontology_endpoint,)
1877+
response = self._connection.get(ontology_endpoint)
18921878

18931879
if response.status_code == requests.codes.ok:
18941880
feature_schema_nodes = response.json()['featureSchemaNodes']
@@ -1964,7 +1950,7 @@ def delete_feature_schema_from_ontology(
19641950
ontology_endpoint = self.rest_endpoint + "/ontologies/" + urllib.parse.quote(
19651951
ontology_id) + "/feature-schemas/" + urllib.parse.quote(
19661952
feature_schema_id)
1967-
response = self._connection.delete(ontology_endpoint,)
1953+
response = self._connection.delete(ontology_endpoint)
19681954

19691955
if response.status_code == requests.codes.ok:
19701956
response_json = response.json()
@@ -1998,7 +1984,7 @@ def unarchive_feature_schema_node(self, ontology_id: str,
19981984
ontology_endpoint = self.rest_endpoint + "/ontologies/" + urllib.parse.quote(
19991985
ontology_id) + '/feature-schemas/' + urllib.parse.quote(
20001986
root_feature_schema_id) + '/unarchive'
2001-
response = self._connection.patch(ontology_endpoint,)
1987+
response = self._connection.patch(ontology_endpoint)
20021988
if response.status_code == requests.codes.ok:
20031989
if not bool(response.json()['unarchived']):
20041990
raise labelbox.exceptions.LabelboxError(

0 commit comments

Comments
 (0)