Skip to content

Commit fa835a3

Browse files
committed
remove optional arguments entirely when not set
1 parent 861306a commit fa835a3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

nucleus/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1209,8 +1209,13 @@ def create_object_index(
12091209
model_run_id: id of the model run for generating embeddings on. Mutually exclusive with gt_only
12101210
gt_only: Whether we are generating embeddings on the ground truth objects in a dataset. Mutually exclusive with model_run_id
12111211
"""
1212+
payload: Dict[str, Union[str, bool]] = {}
1213+
if model_run_id:
1214+
payload["model_run_id"] = model_run_id
1215+
elif gt_only:
1216+
payload["ingest_gt_only"] = True
12121217
return self.make_request(
1213-
{model_run_id: model_run_id or None, gt_only: gt_only or None},
1218+
payload,
12141219
f"indexing/{dataset_id}/internal/object",
12151220
requests_command=requests.post,
12161221
)

0 commit comments

Comments
 (0)