Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(LAB-3326): creation of a new method to assign labelers to assets … #1834

Merged
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/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
Loading