From 035f4248c314c938d47bb1932cb096f8304b7654 Mon Sep 17 00:00:00 2001 From: theodu <82399630+theodu@users.noreply.github.com> Date: Thu, 5 Oct 2023 15:52:58 +0200 Subject: [PATCH] feat: remove status_array from mutations (#1521) Co-authored-by: theodu --- .../entrypoints/mutations/asset/__init__.py | 18 ++++++------------ .../entrypoints/mutations/asset/helpers.py | 2 -- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/kili/entrypoints/mutations/asset/__init__.py b/src/kili/entrypoints/mutations/asset/__init__.py index 615ccfb24..f032941f3 100644 --- a/src/kili/entrypoints/mutations/asset/__init__.py +++ b/src/kili/entrypoints/mutations/asset/__init__.py @@ -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 @@ -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, ) @@ -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, } @@ -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. @@ -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=[['test+pierre@kili-technology.com'], None], ) @@ -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" @@ -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, diff --git a/src/kili/entrypoints/mutations/asset/helpers.py b/src/kili/entrypoints/mutations/asset/helpers.py index 24c85ae19..db584aa9f 100644 --- a/src/kili/entrypoints/mutations/asset/helpers.py +++ b/src/kili/entrypoints/mutations/asset/helpers.py @@ -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, @@ -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,