File tree Expand file tree Collapse file tree 1 file changed +4
-20
lines changed
libs/labelbox/src/labelbox/schema/workflow Expand file tree Collapse file tree 1 file changed +4
-20
lines changed Original file line number Diff line number Diff line change 6161def _validate_definition_id (
6262 definition_id_str : str , node_id : str
6363) -> WorkflowDefinitionId :
64- """Validate and normalize a workflow definition ID with consistent error handling .
64+ """Validate and normalize a workflow definition ID.
6565
6666 Args:
6767 definition_id_str: The definition ID string to validate
@@ -71,26 +71,10 @@ def _validate_definition_id(
7171 WorkflowDefinitionId: Validated definition ID or fallback
7272 """
7373 try :
74- if definition_id_str in (
75- "initial_labeling_task" ,
76- "initial_rework_task" ,
77- "review_task" ,
78- "send_to_rework" ,
79- "logic" ,
80- "done" ,
81- "custom_rework_task" ,
82- "auto_qa" ,
83- ):
84- return WorkflowDefinitionId (definition_id_str )
85- else :
86- logger .warning (
87- f"Unknown WorkflowDefinitionId '{ definition_id_str } ' for node { node_id } . "
88- f"Using InitialLabelingTask as fallback."
89- )
90- return WorkflowDefinitionId .InitialLabelingTask
91- except ValueError :
74+ return WorkflowDefinitionId (definition_id_str )
75+ except ValueError as e :
9276 logger .warning (
93- f"Invalid WorkflowDefinitionId '{ definition_id_str } ' for node { node_id } . "
77+ f"Invalid WorkflowDefinitionId '{ definition_id_str } ' for node { node_id } : { e } . "
9478 f"Using InitialLabelingTask as fallback."
9579 )
9680 return WorkflowDefinitionId .InitialLabelingTask
You can’t perform that action at this time.
0 commit comments