Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/kili/domain/asset/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 15 additions & 2 deletions src/kili/llm/presentation/client/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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),
Expand Down
46 changes: 40 additions & 6 deletions src/kili/presentation/client/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down
68 changes: 60 additions & 8 deletions src/kili/presentation/client/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand All @@ -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,
Expand Down Expand Up @@ -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.
Expand All @@ -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,
Expand Down
Loading