Skip to content

Commit b2bfa5d

Browse files
authored
Merge pull request #122 from scaleapi/jihan/bugfix
Fix autotag export api endpoint path
2 parents 83bab96 + 68a96eb commit b2bfa5d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

nucleus/dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def autotag_items(self, autotag_name, for_scores_greater_than=0):
110110
"""
111111
response = self._client.make_request(
112112
payload={AUTOTAG_SCORE_THRESHOLD: for_scores_greater_than},
113-
route=f"autotag/dataset/{self.id}/autotag/{autotag_name}/taggedItems",
113+
route=f"dataset/{self.id}/autotag/{autotag_name}/taggedItems",
114114
requests_command=requests.get,
115115
)
116116
return response
@@ -136,7 +136,7 @@ def autotag_training_items(self, autotag_name):
136136
"""
137137
response = self._client.make_request(
138138
payload={},
139-
route=f"autotag/dataset/{self.id}/autotag/{autotag_name}/trainingItems",
139+
route=f"dataset/{self.id}/autotag/{autotag_name}/trainingItems",
140140
requests_command=requests.get,
141141
)
142142
return response

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exclude = '''
2121

2222
[tool.poetry]
2323
name = "scale-nucleus"
24-
version = "0.1.20"
24+
version = "0.1.21"
2525
description = "The official Python client library for Nucleus, the Data Platform for AI"
2626
license = "MIT"
2727
authors = ["Scale AI Nucleus Team <nucleusapi@scaleapi.com>"]

tests/test_dataset.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,11 @@ def test_raises_error_for_duplicate():
332332
def test_dataset_export_autotag_tagged_items(CLIENT):
333333
# This test can only run for the test user who has an indexed dataset.
334334
# TODO: if/when we can create autotags via api, create one instead.
335-
if NUCLEUS_PYTEST_USER_ID in CLIENT.api_key:
335+
if NUCLEUS_PYTEST_USER_ID in os.environ["NUCLEUS_PYTEST_USER_ID"]:
336336
dataset = CLIENT.get_dataset(DATASET_WITH_AUTOTAG)
337337

338338
with pytest.raises(NucleusAPIError) as api_error:
339-
dataset.autotag_scores(autotag_name="NONSENSE_GARBAGE")
339+
dataset.autotag_items(autotag_name="NONSENSE_GARBAGE")
340340
assert (
341341
f"The autotag NONSENSE_GARBAGE was not found in dataset {DATASET_WITH_AUTOTAG}"
342342
in str(api_error.value)
@@ -362,19 +362,19 @@ def test_dataset_export_autotag_tagged_items(CLIENT):
362362
def test_dataset_export_autotag_training_items(CLIENT):
363363
# This test can only run for the test user who has an indexed dataset.
364364
# TODO: if/when we can create autotags via api, create one instead.
365-
if NUCLEUS_PYTEST_USER_ID in CLIENT.api_key:
365+
if NUCLEUS_PYTEST_USER_ID in os.environ["NUCLEUS_PYTEST_USER_ID"]:
366366
dataset = CLIENT.get_dataset(DATASET_WITH_AUTOTAG)
367367

368368
with pytest.raises(NucleusAPIError) as api_error:
369-
dataset.autotag_scores(autotag_name="NONSENSE_GARBAGE")
369+
dataset.autotag_training_items(autotag_name="NONSENSE_GARBAGE")
370370
assert (
371371
f"The autotag NONSENSE_GARBAGE was not found in dataset {DATASET_WITH_AUTOTAG}"
372372
in str(api_error.value)
373373
)
374374

375375
items = dataset.autotag_training_items(autotag_name="PytestTestTag")
376376

377-
assert "autotagItems" in items
377+
assert "autotagPositiveTrainingItems" in items
378378
assert "autotag" in items
379379

380380
autotagTrainingItems = items["autotagPositiveTrainingItems"]

0 commit comments

Comments
 (0)