Skip to content

Commit

Permalink
feat: remove status_array from mutations (#1521)
Browse files Browse the repository at this point in the history
Co-authored-by: theodu <[email protected]>
  • Loading branch information
theodu and theodu authored Oct 5, 2023
1 parent ece2d63 commit 035f424
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
18 changes: 6 additions & 12 deletions src/kili/entrypoints/mutations/asset/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ def append_many_to_dataset(
If None, random identifiers are created.
id_array: Disabled parameter. Do not use.
is_honeypot_array: Whether to use the asset for honeypot
status_array: By default, all imported assets are set to `TODO`. Other options:
`ONGOING`, `LABELED`, `REVIEWED`.
status_array: DEPRECATED and does not have any effect.
json_content_array: Useful for `VIDEO` or `TEXT` projects only.
- For `VIDEO` projects, each element is a sequence of frames, i.e. a
Expand Down Expand Up @@ -134,8 +133,8 @@ def append_many_to_dataset(

if status_array is not None:
warnings.warn(
"status_array is deprecated, asset status is automatically computed based on"
" its labels and cannot be overwritten.",
"status_array is deprecated and will not be sent in the call. Asset status is"
" automatically computed based on its labels and cannot be overwritten.",
DeprecationWarning,
stacklevel=1,
)
Expand All @@ -154,7 +153,6 @@ def append_many_to_dataset(
"json_content": json_content_array,
"external_id": external_id_array,
"id": id_array,
"status": status_array,
"json_metadata": json_metadata_array,
"is_honeypot": is_honeypot_array,
}
Expand Down Expand Up @@ -213,8 +211,7 @@ def update_properties_in_assets(
is a text formatted using RichText.
- For a Video project, the`json_content` is a json containg urls pointing
to each frame of the video.
status_array: Each element should be in `TODO`, `ONGOING`, `LABELED`,
`TO_REVIEW`, `REVIEWED`.
status_array: DEPRECATED and does not have any effect.
is_used_for_consensus_array: Whether to use the asset to compute consensus kpis or not.
is_honeypot_array: Whether to use the asset for honeypot.
project_id: The project ID. Only required if `external_ids` argument is provided.
Expand All @@ -238,7 +235,6 @@ def update_properties_in_assets(
is_honeypot_array=[True, True],
is_used_for_consensus_array=[True, False],
priorities=[None, 2],
status_array=['LABELED', 'REVIEWED'],
to_be_labeled_by_array=[['[email protected]'], None],
)
Expand Down Expand Up @@ -266,12 +262,11 @@ def update_properties_in_assets(

if status_array is not None:
warnings.warn(
"status_array is deprecated, asset status is automatically computed based on"
" its labels and cannot be overwritten.",
"status_array is deprecated and will not be sent in the call. Asset status is"
" automatically computed based on its labels and cannot be overwritten.",
DeprecationWarning,
stacklevel=1,
)

if asset_ids is not None and external_ids is not None:
warnings.warn(
"The use of `external_ids` argument has changed. It is now used to identify"
Expand All @@ -294,7 +289,6 @@ def update_properties_in_assets(
to_be_labeled_by_array=to_be_labeled_by_array,
contents=contents,
json_contents=json_contents,
status_array=status_array,
is_used_for_consensus_array=is_used_for_consensus_array,
is_honeypot_array=is_honeypot_array,
resolution_array=resolution_array,
Expand Down
2 changes: 0 additions & 2 deletions src/kili/entrypoints/mutations/asset/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def process_update_properties_in_assets_parameters(
to_be_labeled_by_array: Optional[List[List[str]]] = None,
contents: Optional[List[str]] = None,
json_contents: Optional[List[str]] = None,
status_array: Optional[List[str]] = None,
is_used_for_consensus_array: Optional[List[bool]] = None,
is_honeypot_array: Optional[List[bool]] = None,
resolution_array: Optional[List[dict]] = None,
Expand Down Expand Up @@ -47,7 +46,6 @@ def process_update_properties_in_assets_parameters(
"shouldResetToBeLabeledBy": to_be_labeled_by_array,
"content": contents,
"jsonContent": json_contents,
"status": status_array,
"isUsedForConsensus": is_used_for_consensus_array,
"isHoneypot": is_honeypot_array,
"pageResolutions": page_resolutions_array,
Expand Down

0 comments on commit 035f424

Please sign in to comment.