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
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

from typing import Dict, Union

from cuid import cuid

from kili.domain.project import WorkflowStepCreate, WorkflowStepUpdate

from .types import ProjectWorkflowDataKiliAPIGatewayInput
Expand All @@ -28,7 +26,7 @@ def project_input_mapper(data: ProjectWorkflowDataKiliAPIGatewayInput) -> Dict:
def update_step_mapper(data: Union[WorkflowStepCreate, WorkflowStepUpdate]) -> Dict:
"""Build the GraphQL create StepData variable to be sent in an operation."""
step = {
"id": data["id"] if "id" in data else cuid(),
"id": data["id"] if "id" in data else None,
"name": data["name"] if "name" in data else None,
"consensusCoverage": data["consensus_coverage"] if "consensus_coverage" in data else None,
"numberOfExpectedLabelsForConsensus": data["number_of_expected_labels_for_consensus"]
Expand Down
2 changes: 1 addition & 1 deletion src/kili/domain/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class WorkflowStepCreate(TypedDict, total=False):
class WorkflowStepUpdate(TypedDict, total=False):
"""Project workflow step."""

id: Required[str]
id: Optional[str]
name: Optional[str]
consensus_coverage: Optional[int]
number_of_expected_labels_for_consensus: Optional[int]
Expand Down
2 changes: 1 addition & 1 deletion src/kili/presentation/client/project_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def update_project_workflow(
ensuring independent review and labeling processes
create_steps: List of steps to create in the project workflow.
update_steps: List of steps to update in the project workflow.
delete_steps: List of step IDs to delete from the project workflow.
delete_steps: List of step IDs or names to delete from the project workflow.

Returns:
A dict with the changed properties which indicates if the mutation was successful,
Expand Down
Loading