diff --git a/src/kili/domain/asset/asset.py b/src/kili/domain/asset/asset.py index f1a98853f..57de34dd2 100644 --- a/src/kili/domain/asset/asset.py +++ b/src/kili/domain/asset/asset.py @@ -17,7 +17,10 @@ AssetStatus = Literal["TODO", "ONGOING", "LABELED", "REVIEWED", "TO_REVIEW"] -StatusInStep = Literal["TO_DO", "DOING", "PARTIALLY_DONE", "REDO", "DONE", "SKIPPED"] +# DOING and REDO are depreacated but still supported for backward compatibility. They will be removed in the future. +StatusInStep = Literal[ + "TO_DO", "DOING", "IN_PROGRESS", "PARTIALLY_DONE", "REWORK", "REDO", "DONE", "SKIPPED" +] @dataclass diff --git a/src/kili/llm/presentation/client/llm.py b/src/kili/llm/presentation/client/llm.py index 28cbb7d69..654ad36b5 100644 --- a/src/kili/llm/presentation/client/llm.py +++ b/src/kili/llm/presentation/client/llm.py @@ -98,8 +98,8 @@ def export( step_name_in: Returned assets are in a step whose name belong to that list, if given. Only applicable if the project is in WorkflowV2. step_status_in: Returned assets have the status of their step that belongs to that list, if given. - Possible choices: `TO_DO`, `DOING`, `PARTIALLY_DONE`, `REDO`, `DONE`, `SKIPPED`. - Only applicable if the project is in WorkflowV2. + Possible choices: `TO_DO`, `DOING`, `IN_PROGRESS`, `PARTIALLY_DONE`, `REWORK`, `REDO`, `DONE`, `SKIPPED` . + Only applicable if the project is in WorkflowV2. Note that `DOING` and `REDO` are deprecated, use `IN_PROGRESS` and `REWORK` instead. !!! Example ```python kili.llm.export("your_project_id") @@ -108,6 +108,19 @@ def export( if asset_ids and external_ids: raise ValueError("You cannot provide both asset_ids and external_ids") + if step_status_in is not None and "DOING" in step_status_in: + warnings.warn( + "Step status 'DOING' is deprecated, use 'IN_PROGRESS' instead", + DeprecationWarning, + stacklevel=1, + ) + if step_status_in is not None and "REDO" in step_status_in: + warnings.warn( + "Step status 'REDO' is deprecated, use 'REWORK' instead", + DeprecationWarning, + stacklevel=1, + ) + if external_ids is not None and asset_ids is None: id_map = AssetUseCasesUtils(self.kili_api_gateway).infer_ids_from_external_ids( asset_external_ids=cast(list[AssetExternalId], external_ids), diff --git a/src/kili/presentation/client/asset.py b/src/kili/presentation/client/asset.py index 93c9cc511..84f38138d 100644 --- a/src/kili/presentation/client/asset.py +++ b/src/kili/presentation/client/asset.py @@ -385,8 +385,8 @@ def assets( step_status_in: Returned assets have the status in their step that belongs to that list, if given. Only applicable if the project is in WorkflowV2. step_status_not_in: Returned assets have the status in their step that does not belong to that list, if given. - Possible choices: `TO_DO`, `DOING`, `PARTIALLY_DONE`, `REDO`, `DONE`, `SKIPPED`. - Only applicable if the project is in WorkflowV2. + Possible choices: `TO_DO`, `DOING`, `IN_PROGRESS`, `PARTIALLY_DONE`, `REWORK`, `REDO`, `DONE`, `SKIPPED` . + Only applicable if the project is in WorkflowV2. Note that `DOING` and `REDO` are deprecated, use `IN_PROGRESS` and `REWORK` instead. !!! info "Dates format" Date strings should have format: "YYYY-MM-DD" @@ -447,6 +447,23 @@ def assets( stacklevel=1, ) + if (step_status_in is not None and "DOING" in step_status_in) or ( + step_status_not_in is not None and "DOING" in step_status_not_in + ): + warnings.warn( + "Step status 'DOING' is deprecated, use 'IN_PROGRESS' instead", + DeprecationWarning, + stacklevel=1, + ) + if (step_status_in is not None and "REDO" in step_status_in) or ( + step_status_not_in is not None and "REDO" in step_status_not_in + ): + warnings.warn( + "Step status 'REDO' is deprecated, use 'REWORK' instead", + DeprecationWarning, + stacklevel=1, + ) + _warn_deprecated_gt_lt_args( consensus_mark_gt=consensus_mark_gt, consensus_mark_lt=consensus_mark_lt, @@ -719,11 +736,11 @@ def count_assets( step_name_not_in: Returned assets are in a step whose name does not belong to that list, if given. Only applicable if the project is in WorkflowV2. step_status_in: Returned assets have the status of their step that belongs to that list, if given. - Possible choices: `TO_DO`, `DOING`, `PARTIALLY_DONE`, `REDO`, `DONE`, `SKIPPED`. - Only applicable if the project is in WorkflowV2. + Possible choices: `TO_DO`, `DOING`, `IN_PROGRESS`, `PARTIALLY_DONE`, `REWORK`, `REDO`, `DONE`, `SKIPPED`. + Only applicable if the project is in WorkflowV2. Note that `DOING` and `REDO` are deprecated, use `IN_PROGRESS` and `REWORK` instead. step_status_not_in: Returned assets have the status of their step that does not belong to that list, if given. - Possible choices: `TO_DO`, `DOING`, `PARTIALLY_DONE`, `REDO`, `DONE`, `SKIPPED`. - Only applicable if the project is in WorkflowV2. + Possible choices: `TO_DO`, `DOING`, `IN_PROGRESS`, `PARTIALLY_DONE`, `REWORK`, `REDO`, `DONE`, `SKIPPED`. + Only applicable if the project is in WorkflowV2. Note that `DOING` and `REDO` are deprecated, use `IN_PROGRESS` and `REWORK` instead. step_name_and_status_in: Returned assets match at least one of the given (step_name, step_status) pairs. Only applicable if the project is in WorkflowV2. 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( stacklevel=1, ) + if (step_status_in is not None and "DOING" in step_status_in) or ( + step_status_not_in is not None and "DOING" in step_status_not_in + ): + warnings.warn( + "Step status 'DOING' is deprecated, use 'IN_PROGRESS' instead", + DeprecationWarning, + stacklevel=1, + ) + if (step_status_in is not None and "REDO" in step_status_in) or ( + step_status_not_in is not None and "REDO" in step_status_not_in + ): + warnings.warn( + "Step status 'REDO' is deprecated, use 'REWORK' instead", + DeprecationWarning, + stacklevel=1, + ) + _warn_deprecated_gt_lt_args( consensus_mark_gt=consensus_mark_gt, consensus_mark_lt=consensus_mark_lt, diff --git a/src/kili/presentation/client/label.py b/src/kili/presentation/client/label.py index ca38d21e0..034513bd2 100644 --- a/src/kili/presentation/client/label.py +++ b/src/kili/presentation/client/label.py @@ -102,8 +102,8 @@ def count_labels( asset_step_name_in: Returned assets are in a step whose name belong to that list, if given. Only applicable if the project is in WorkflowV2. asset_step_status_in: Returned assets have the status of their step that belongs to that list, if given. - Possible choices: `TO_DO`, `DOING`, `PARTIALLY_DONE`, `REDO`, `DONE`, `SKIPPED`. - Only applicable if the project is in WorkflowV2. + Possible choices: `TO_DO`, `DOING`, `IN_PROGRESS`, `PARTIALLY_DONE`, `REWORK`, `REDO`, `DONE`, `SKIPPED`. + Only applicable if the project is in WorkflowV2. Note that `DOING` and `REDO` are deprecated, use `IN_PROGRESS` and `REWORK` instead. author_in: Returned labels should have been made by authors in that list, if given. An author can be designated by the first name, the last name, or the first name + last name. created_at: Returned labels should have a label whose creation date is equal to this date. @@ -126,6 +126,19 @@ def count_labels( if category_search: validate_category_search_query(category_search) + if asset_step_status_in is not None and "DOING" in asset_step_status_in: + warnings.warn( + "Step status 'DOING' is deprecated, use 'IN_PROGRESS' instead", + DeprecationWarning, + stacklevel=1, + ) + if asset_step_status_in is not None and "REDO" in asset_step_status_in: + warnings.warn( + "Step status 'REDO' is deprecated, use 'REWORK' instead", + DeprecationWarning, + stacklevel=1, + ) + asset_step_id_in = None if ( asset_status_in is not None @@ -401,8 +414,8 @@ def labels( asset_step_name_in: Returned assets are in a step whose name belong to that list, if given. Only applicable if the project is in WorkflowV2. asset_step_status_in: Returned assets have the status of their step that belongs to that list, if given. - Possible choices: `TO_DO`, `DOING`, `PARTIALLY_DONE`, `REDO`, `DONE`, `SKIPPED`. - Only applicable if the project is in WorkflowV2. + Possible choices: `TO_DO`, `DOING`, `IN_PROGRESS`, `PARTIALLY_DONE`, `REWORK`, `REDO`, `DONE`, `SKIPPED`. + Only applicable if the project is in WorkflowV2. Note that `DOING` and `REDO` are deprecated, use `IN_PROGRESS` and `REWORK` instead. author_in: Returned labels should have been made by authors in that list, if given. An author can be designated by the first name, the last name, or the first name + last name. created_at: Returned labels should have their creation date equal to this date. @@ -455,6 +468,19 @@ def labels( if category_search: validate_category_search_query(category_search) + if asset_step_status_in is not None and "DOING" in asset_step_status_in: + warnings.warn( + "Step status 'DOING' is deprecated, use 'IN_PROGRESS' instead", + DeprecationWarning, + stacklevel=1, + ) + if asset_step_status_in is not None and "REDO" in asset_step_status_in: + warnings.warn( + "Step status 'REDO' is deprecated, use 'REWORK' instead", + DeprecationWarning, + stacklevel=1, + ) + disable_tqdm = resolve_disable_tqdm(disable_tqdm, getattr(self, "disable_tqdm", None)) disable_tqdm = disable_tqdm_if_as_generator(as_generator, disable_tqdm) options = QueryOptions(disable_tqdm, first, skip) @@ -650,8 +676,8 @@ def predictions( asset_step_name_in: Returned assets are in a step whose name belong to that list, if given. Only applicable if the project is in WorkflowV2. asset_step_status_in: Returned assets have the status of their step that belongs to that list, if given. - Possible choices: `TO_DO`, `DOING`, `PARTIALLY_DONE`, `REDO`, `DONE`, `SKIPPED`. - Only applicable if the project is in WorkflowV2. + Possible choices: `TO_DO`, `DOING`, `IN_PROGRESS`, `PARTIALLY_DONE`, `REWORK`, `REDO`, `DONE`, `SKIPPED`. + Only applicable if the project is in WorkflowV2. Note that `DOING` and `REDO` are deprecated, use `IN_PROGRESS` and `REWORK` instead. author_in: Returned labels should have been made by authors in that list, if given. An author can be designated by the first name, the last name, or the first name + last name. created_at: Returned labels should have a label whose creation date is equal to this date. @@ -676,6 +702,19 @@ def predictions( Examples: >>> kili.predictions(project_id=project_id) # returns a list of prediction labels of a project """ + if asset_step_status_in is not None and "DOING" in asset_step_status_in: + warnings.warn( + "Step status 'DOING' is deprecated, use 'IN_PROGRESS' instead", + DeprecationWarning, + stacklevel=1, + ) + if asset_step_status_in is not None and "REDO" in asset_step_status_in: + warnings.warn( + "Step status 'REDO' is deprecated, use 'REWORK' instead", + DeprecationWarning, + stacklevel=1, + ) + if as_generator: return self.labels( project_id=project_id, @@ -843,8 +882,8 @@ def inferences( asset_step_name_in: Returned assets are in a step whose name belong to that list, if given. Only applicable if the project is in WorkflowV2. asset_step_status_in: Returned assets have the status of their step that belongs to that list, if given. - Possible choices: `TO_DO`, `DOING`, `PARTIALLY_DONE`, `REDO`, `DONE`, `SKIPPED`. - Only applicable if the project is in WorkflowV2. + Possible choices: `TO_DO`, `DOING`, `IN_PROGRESS`, `PARTIALLY_DONE`, `REWORK`, `REDO`, `DONE`, `SKIPPED`. + Only applicable if the project is in WorkflowV2. Note that `DOING` and `REDO` are deprecated, use `IN_PROGRESS` and `REWORK` instead. author_in: Returned labels should have been made by authors in that list, if given. An author can be designated by the first name, the last name, or the first name + last name. created_at: Returned labels should have a label whose creation date is equal to this date. @@ -869,6 +908,19 @@ def inferences( Examples: >>> kili.inferences(project_id=project_id) # returns a list of inference labels of a project """ + if asset_step_status_in is not None and "DOING" in asset_step_status_in: + warnings.warn( + "Step status 'DOING' is deprecated, use 'IN_PROGRESS' instead", + DeprecationWarning, + stacklevel=1, + ) + if asset_step_status_in is not None and "REDO" in asset_step_status_in: + warnings.warn( + "Step status 'REDO' is deprecated, use 'REWORK' instead", + DeprecationWarning, + stacklevel=1, + ) + if as_generator: return self.labels( project_id=project_id,