Skip to content

Commit d0ee3d6

Browse files
authored
Merge pull request #2042 from kili-technology/feature/lab-4343-aau-i-have-the-same-status-name-between-the-ui-and-the
feat(lab-4343): remove client specific status
2 parents 530bd62 + 24fc677 commit d0ee3d6

4 files changed

Lines changed: 119 additions & 17 deletions

File tree

src/kili/domain/asset/asset.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717

1818
AssetStatus = Literal["TODO", "ONGOING", "LABELED", "REVIEWED", "TO_REVIEW"]
1919

20-
StatusInStep = Literal["TO_DO", "DOING", "PARTIALLY_DONE", "REDO", "DONE", "SKIPPED"]
20+
# DOING and REDO are depreacated but still supported for backward compatibility. They will be removed in the future.
21+
StatusInStep = Literal[
22+
"TO_DO", "DOING", "IN_PROGRESS", "PARTIALLY_DONE", "REWORK", "REDO", "DONE", "SKIPPED"
23+
]
2124

2225

2326
@dataclass

src/kili/llm/presentation/client/llm.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ def export(
9898
step_name_in: Returned assets are in a step whose name belong to that list, if given.
9999
Only applicable if the project is in WorkflowV2.
100100
step_status_in: Returned assets have the status of their step that belongs to that list, if given.
101-
Possible choices: `TO_DO`, `DOING`, `PARTIALLY_DONE`, `REDO`, `DONE`, `SKIPPED`.
102-
Only applicable if the project is in WorkflowV2.
101+
Possible choices: `TO_DO`, `DOING`, `IN_PROGRESS`, `PARTIALLY_DONE`, `REWORK`, `REDO`, `DONE`, `SKIPPED` .
102+
Only applicable if the project is in WorkflowV2. Note that `DOING` and `REDO` are deprecated, use `IN_PROGRESS` and `REWORK` instead.
103103
!!! Example
104104
```python
105105
kili.llm.export("your_project_id")
@@ -108,6 +108,19 @@ def export(
108108
if asset_ids and external_ids:
109109
raise ValueError("You cannot provide both asset_ids and external_ids")
110110

111+
if step_status_in is not None and "DOING" in step_status_in:
112+
warnings.warn(
113+
"Step status 'DOING' is deprecated, use 'IN_PROGRESS' instead",
114+
DeprecationWarning,
115+
stacklevel=1,
116+
)
117+
if step_status_in is not None and "REDO" in step_status_in:
118+
warnings.warn(
119+
"Step status 'REDO' is deprecated, use 'REWORK' instead",
120+
DeprecationWarning,
121+
stacklevel=1,
122+
)
123+
111124
if external_ids is not None and asset_ids is None:
112125
id_map = AssetUseCasesUtils(self.kili_api_gateway).infer_ids_from_external_ids(
113126
asset_external_ids=cast(list[AssetExternalId], external_ids),

src/kili/presentation/client/asset.py

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,8 @@ def assets(
385385
step_status_in: Returned assets have the status in their step that belongs to that list, if given.
386386
Only applicable if the project is in WorkflowV2.
387387
step_status_not_in: Returned assets have the status in their step that does not belong to that list, if given.
388-
Possible choices: `TO_DO`, `DOING`, `PARTIALLY_DONE`, `REDO`, `DONE`, `SKIPPED`.
389-
Only applicable if the project is in WorkflowV2.
388+
Possible choices: `TO_DO`, `DOING`, `IN_PROGRESS`, `PARTIALLY_DONE`, `REWORK`, `REDO`, `DONE`, `SKIPPED` .
389+
Only applicable if the project is in WorkflowV2. Note that `DOING` and `REDO` are deprecated, use `IN_PROGRESS` and `REWORK` instead.
390390
391391
!!! info "Dates format"
392392
Date strings should have format: "YYYY-MM-DD"
@@ -447,6 +447,23 @@ def assets(
447447
stacklevel=1,
448448
)
449449

450+
if (step_status_in is not None and "DOING" in step_status_in) or (
451+
step_status_not_in is not None and "DOING" in step_status_not_in
452+
):
453+
warnings.warn(
454+
"Step status 'DOING' is deprecated, use 'IN_PROGRESS' instead",
455+
DeprecationWarning,
456+
stacklevel=1,
457+
)
458+
if (step_status_in is not None and "REDO" in step_status_in) or (
459+
step_status_not_in is not None and "REDO" in step_status_not_in
460+
):
461+
warnings.warn(
462+
"Step status 'REDO' is deprecated, use 'REWORK' instead",
463+
DeprecationWarning,
464+
stacklevel=1,
465+
)
466+
450467
_warn_deprecated_gt_lt_args(
451468
consensus_mark_gt=consensus_mark_gt,
452469
consensus_mark_lt=consensus_mark_lt,
@@ -719,11 +736,11 @@ def count_assets(
719736
step_name_not_in: Returned assets are in a step whose name does not belong to that list, if given.
720737
Only applicable if the project is in WorkflowV2.
721738
step_status_in: Returned assets have the status of their step that belongs to that list, if given.
722-
Possible choices: `TO_DO`, `DOING`, `PARTIALLY_DONE`, `REDO`, `DONE`, `SKIPPED`.
723-
Only applicable if the project is in WorkflowV2.
739+
Possible choices: `TO_DO`, `DOING`, `IN_PROGRESS`, `PARTIALLY_DONE`, `REWORK`, `REDO`, `DONE`, `SKIPPED`.
740+
Only applicable if the project is in WorkflowV2. Note that `DOING` and `REDO` are deprecated, use `IN_PROGRESS` and `REWORK` instead.
724741
step_status_not_in: Returned assets have the status of their step that does not belong to that list, if given.
725-
Possible choices: `TO_DO`, `DOING`, `PARTIALLY_DONE`, `REDO`, `DONE`, `SKIPPED`.
726-
Only applicable if the project is in WorkflowV2.
742+
Possible choices: `TO_DO`, `DOING`, `IN_PROGRESS`, `PARTIALLY_DONE`, `REWORK`, `REDO`, `DONE`, `SKIPPED`.
743+
Only applicable if the project is in WorkflowV2. Note that `DOING` and `REDO` are deprecated, use `IN_PROGRESS` and `REWORK` instead.
727744
step_name_and_status_in: Returned assets match at least one of the given (step_name, step_status) pairs.
728745
Only applicable if the project is in WorkflowV2.
729746
step_name_and_status_not_in: Returned assets do not match any of the given (step_name, step_status) pairs.
@@ -756,6 +773,23 @@ def count_assets(
756773
stacklevel=1,
757774
)
758775

776+
if (step_status_in is not None and "DOING" in step_status_in) or (
777+
step_status_not_in is not None and "DOING" in step_status_not_in
778+
):
779+
warnings.warn(
780+
"Step status 'DOING' is deprecated, use 'IN_PROGRESS' instead",
781+
DeprecationWarning,
782+
stacklevel=1,
783+
)
784+
if (step_status_in is not None and "REDO" in step_status_in) or (
785+
step_status_not_in is not None and "REDO" in step_status_not_in
786+
):
787+
warnings.warn(
788+
"Step status 'REDO' is deprecated, use 'REWORK' instead",
789+
DeprecationWarning,
790+
stacklevel=1,
791+
)
792+
759793
_warn_deprecated_gt_lt_args(
760794
consensus_mark_gt=consensus_mark_gt,
761795
consensus_mark_lt=consensus_mark_lt,

src/kili/presentation/client/label.py

Lines changed: 60 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ def count_labels(
102102
asset_step_name_in: Returned assets are in a step whose name belong to that list, if given.
103103
Only applicable if the project is in WorkflowV2.
104104
asset_step_status_in: Returned assets have the status of their step that belongs to that list, if given.
105-
Possible choices: `TO_DO`, `DOING`, `PARTIALLY_DONE`, `REDO`, `DONE`, `SKIPPED`.
106-
Only applicable if the project is in WorkflowV2.
105+
Possible choices: `TO_DO`, `DOING`, `IN_PROGRESS`, `PARTIALLY_DONE`, `REWORK`, `REDO`, `DONE`, `SKIPPED`.
106+
Only applicable if the project is in WorkflowV2. Note that `DOING` and `REDO` are deprecated, use `IN_PROGRESS` and `REWORK` instead.
107107
author_in: Returned labels should have been made by authors in that list, if given.
108108
An author can be designated by the first name, the last name, or the first name + last name.
109109
created_at: Returned labels should have a label whose creation date is equal to this date.
@@ -126,6 +126,19 @@ def count_labels(
126126
if category_search:
127127
validate_category_search_query(category_search)
128128

129+
if asset_step_status_in is not None and "DOING" in asset_step_status_in:
130+
warnings.warn(
131+
"Step status 'DOING' is deprecated, use 'IN_PROGRESS' instead",
132+
DeprecationWarning,
133+
stacklevel=1,
134+
)
135+
if asset_step_status_in is not None and "REDO" in asset_step_status_in:
136+
warnings.warn(
137+
"Step status 'REDO' is deprecated, use 'REWORK' instead",
138+
DeprecationWarning,
139+
stacklevel=1,
140+
)
141+
129142
asset_step_id_in = None
130143
if (
131144
asset_status_in is not None
@@ -401,8 +414,8 @@ def labels(
401414
asset_step_name_in: Returned assets are in a step whose name belong to that list, if given.
402415
Only applicable if the project is in WorkflowV2.
403416
asset_step_status_in: Returned assets have the status of their step that belongs to that list, if given.
404-
Possible choices: `TO_DO`, `DOING`, `PARTIALLY_DONE`, `REDO`, `DONE`, `SKIPPED`.
405-
Only applicable if the project is in WorkflowV2.
417+
Possible choices: `TO_DO`, `DOING`, `IN_PROGRESS`, `PARTIALLY_DONE`, `REWORK`, `REDO`, `DONE`, `SKIPPED`.
418+
Only applicable if the project is in WorkflowV2. Note that `DOING` and `REDO` are deprecated, use `IN_PROGRESS` and `REWORK` instead.
406419
author_in: Returned labels should have been made by authors in that list, if given.
407420
An author can be designated by the first name, the last name, or the first name + last name.
408421
created_at: Returned labels should have their creation date equal to this date.
@@ -455,6 +468,19 @@ def labels(
455468
if category_search:
456469
validate_category_search_query(category_search)
457470

471+
if asset_step_status_in is not None and "DOING" in asset_step_status_in:
472+
warnings.warn(
473+
"Step status 'DOING' is deprecated, use 'IN_PROGRESS' instead",
474+
DeprecationWarning,
475+
stacklevel=1,
476+
)
477+
if asset_step_status_in is not None and "REDO" in asset_step_status_in:
478+
warnings.warn(
479+
"Step status 'REDO' is deprecated, use 'REWORK' instead",
480+
DeprecationWarning,
481+
stacklevel=1,
482+
)
483+
458484
disable_tqdm = resolve_disable_tqdm(disable_tqdm, getattr(self, "disable_tqdm", None))
459485
disable_tqdm = disable_tqdm_if_as_generator(as_generator, disable_tqdm)
460486
options = QueryOptions(disable_tqdm, first, skip)
@@ -650,8 +676,8 @@ def predictions(
650676
asset_step_name_in: Returned assets are in a step whose name belong to that list, if given.
651677
Only applicable if the project is in WorkflowV2.
652678
asset_step_status_in: Returned assets have the status of their step that belongs to that list, if given.
653-
Possible choices: `TO_DO`, `DOING`, `PARTIALLY_DONE`, `REDO`, `DONE`, `SKIPPED`.
654-
Only applicable if the project is in WorkflowV2.
679+
Possible choices: `TO_DO`, `DOING`, `IN_PROGRESS`, `PARTIALLY_DONE`, `REWORK`, `REDO`, `DONE`, `SKIPPED`.
680+
Only applicable if the project is in WorkflowV2. Note that `DOING` and `REDO` are deprecated, use `IN_PROGRESS` and `REWORK` instead.
655681
author_in: Returned labels should have been made by authors in that list, if given.
656682
An author can be designated by the first name, the last name, or the first name + last name.
657683
created_at: Returned labels should have a label whose creation date is equal to this date.
@@ -676,6 +702,19 @@ def predictions(
676702
Examples:
677703
>>> kili.predictions(project_id=project_id) # returns a list of prediction labels of a project
678704
"""
705+
if asset_step_status_in is not None and "DOING" in asset_step_status_in:
706+
warnings.warn(
707+
"Step status 'DOING' is deprecated, use 'IN_PROGRESS' instead",
708+
DeprecationWarning,
709+
stacklevel=1,
710+
)
711+
if asset_step_status_in is not None and "REDO" in asset_step_status_in:
712+
warnings.warn(
713+
"Step status 'REDO' is deprecated, use 'REWORK' instead",
714+
DeprecationWarning,
715+
stacklevel=1,
716+
)
717+
679718
if as_generator:
680719
return self.labels(
681720
project_id=project_id,
@@ -843,8 +882,8 @@ def inferences(
843882
asset_step_name_in: Returned assets are in a step whose name belong to that list, if given.
844883
Only applicable if the project is in WorkflowV2.
845884
asset_step_status_in: Returned assets have the status of their step that belongs to that list, if given.
846-
Possible choices: `TO_DO`, `DOING`, `PARTIALLY_DONE`, `REDO`, `DONE`, `SKIPPED`.
847-
Only applicable if the project is in WorkflowV2.
885+
Possible choices: `TO_DO`, `DOING`, `IN_PROGRESS`, `PARTIALLY_DONE`, `REWORK`, `REDO`, `DONE`, `SKIPPED`.
886+
Only applicable if the project is in WorkflowV2. Note that `DOING` and `REDO` are deprecated, use `IN_PROGRESS` and `REWORK` instead.
848887
author_in: Returned labels should have been made by authors in that list, if given.
849888
An author can be designated by the first name, the last name, or the first name + last name.
850889
created_at: Returned labels should have a label whose creation date is equal to this date.
@@ -869,6 +908,19 @@ def inferences(
869908
Examples:
870909
>>> kili.inferences(project_id=project_id) # returns a list of inference labels of a project
871910
"""
911+
if asset_step_status_in is not None and "DOING" in asset_step_status_in:
912+
warnings.warn(
913+
"Step status 'DOING' is deprecated, use 'IN_PROGRESS' instead",
914+
DeprecationWarning,
915+
stacklevel=1,
916+
)
917+
if asset_step_status_in is not None and "REDO" in asset_step_status_in:
918+
warnings.warn(
919+
"Step status 'REDO' is deprecated, use 'REWORK' instead",
920+
DeprecationWarning,
921+
stacklevel=1,
922+
)
923+
872924
if as_generator:
873925
return self.labels(
874926
project_id=project_id,

0 commit comments

Comments
 (0)