Skip to content

Commit

Permalink
fix(LAB-3326): Add project_id parameters in Assign_assets_to_labelers…
Browse files Browse the repository at this point in the history
… function
  • Loading branch information
Sihem Tchabi authored and Sihem Tchabi committed Dec 17, 2024
1 parent 9269109 commit f55928c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/kili/entrypoints/mutations/asset/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,15 @@ def assign_assets_to_labelers(
to_be_labeled_by_array: List[List[str]],
asset_ids: Optional[List[str]] = None,
external_ids: Optional[List[str]] = None,
project_id: Optional[str] = None,
) -> List[Dict[str, Any]]:
# pylint: disable=line-too-long
"""Assign a list of assets to a list of labelers.
Args:
asset_ids: The internal asset IDs to assign.
external_ids: The external asset IDs to assign (if `asset_ids` is not already provided).
project_id: The project ID. Only required if `external_ids` argument is provided.
to_be_labeled_by_array: The array of list of labelers to assign per labelers (list of userIds).
Returns:
Expand Down Expand Up @@ -244,7 +247,7 @@ def assign_assets_to_labelers(
):
raise MissingArgumentError("Please provide either `asset_ids` or `external_ids`.")

resolved_asset_ids = self._resolve_asset_ids(asset_ids, external_ids, project_id=None)
resolved_asset_ids = self._resolve_asset_ids(asset_ids, external_ids, project_id)

if len(resolved_asset_ids) != len(to_be_labeled_by_array):
raise MutationError("There must be as many assets as there are lists of labelers.")
Expand Down

0 comments on commit f55928c

Please sign in to comment.