Skip to content

Commit cba4287

Browse files
author
Bihan Jiang
committed
address comments
1 parent 245a572 commit cba4287

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

nucleus/__init__.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,14 +1171,7 @@ def create_custom_index(
11711171
f"indexing/{dataset_id}",
11721172
requests_command=requests.post,
11731173
)
1174-
1175-
job = AsyncJob(
1176-
job_id=response_objects[JOB_ID_KEY],
1177-
job_last_known_status=response_objects[JOB_STATUS_KEY],
1178-
job_type=response_objects[JOB_TYPE_KEY],
1179-
job_creation_time=response_objects[JOB_CREATION_TIME_KEY],
1180-
client=self,
1181-
)
1174+
job = AsyncJob.from_json(response_objects, self)
11821175
dataset_id = response_objects[DATASET_ID_KEY]
11831176
message = response_objects[MESSAGE_KEY]
11841177

nucleus/job.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ class AsyncJob:
2121
client: "NucleusClient" # type: ignore # noqa: F821
2222

2323
def status(self) -> Dict[str, str]:
24-
return self.client.make_request(
24+
response = self.client.make_request(
2525
payload={},
2626
route=f"job/{self.job_id}",
2727
requests_command=requests.get,
2828
)
29+
self.job_last_known_status = response["job_status"]
30+
return response
2931

3032
def errors(self) -> List[str]:
3133
return self.client.make_request(

0 commit comments

Comments
 (0)