Skip to content

Commit 4b4a359

Browse files
committed
refactoring following review
1 parent f6923e3 commit 4b4a359

File tree

9 files changed

+2547
-2747
lines changed

9 files changed

+2547
-2747
lines changed

libs/labelbox/src/labelbox/schema/workflow/__init__.py

Lines changed: 58 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,12 @@
77
from labelbox.schema.workflow.enums import (
88
WorkflowDefinitionId,
99
NodeOutput,
10+
NodeInput,
11+
MatchFilters,
12+
Scope,
1013
FilterField,
1114
FilterOperator,
1215
)
13-
from labelbox.schema.workflow.filters import (
14-
Filter,
15-
UserFilter,
16-
MetadataFilter,
17-
TimeRangeFilter,
18-
DatasetFilter,
19-
AnnotationFilter,
20-
NLSearchFilter,
21-
)
2216
from labelbox.schema.workflow.base import (
2317
BaseWorkflowNode,
2418
NodePosition,
@@ -31,44 +25,89 @@
3125
LogicNode,
3226
DoneNode,
3327
CustomReworkNode,
28+
AutoQANode,
3429
UnknownWorkflowNode,
3530
)
3631
from labelbox.schema.workflow.edges import (
3732
WorkflowEdge,
3833
WorkflowEdgeFactory,
3934
)
4035
from labelbox.schema.workflow.graph import ProjectWorkflowGraph
41-
from labelbox.schema.workflow.project_filter import ProjectWorkflowFilter
42-
from labelbox.schema.workflow.workflow import ProjectWorkflow
36+
from labelbox.schema.workflow.workflow import ProjectWorkflow, NodeType
37+
38+
# Import Fluent DSL for improved filter construction
39+
from labelbox.schema.workflow.project_filter import (
40+
# Filter construction functions
41+
created_by,
42+
labeled_by,
43+
annotation,
44+
sample,
45+
dataset,
46+
batch,
47+
issue_category,
48+
model_prediction,
49+
natural_language,
50+
# Metadata helper functions (NEW - recommended)
51+
metadata,
52+
condition,
53+
# Field instances for chaining
54+
labeled_at,
55+
labeling_time,
56+
review_time,
57+
consensus_average,
58+
feature_consensus_average,
59+
# Main filter class
60+
ProjectWorkflowFilter,
61+
# Utility functions
62+
convert_to_api_format,
63+
)
4364

4465
# Re-export key classes at the module level
4566
__all__ = [
67+
# Core workflow components
4668
"WorkflowDefinitionId",
4769
"NodeOutput",
70+
"NodeInput",
71+
"MatchFilters",
72+
"Scope",
4873
"FilterField",
4974
"FilterOperator",
5075
"BaseWorkflowNode",
5176
"NodePosition",
52-
"Filter",
53-
"UserFilter",
54-
"MetadataFilter",
55-
"TimeRangeFilter",
56-
"DatasetFilter",
57-
"AnnotationFilter",
58-
"NLSearchFilter",
5977
"InitialLabelingNode",
6078
"InitialReworkNode",
6179
"ReviewNode",
6280
"ReworkNode",
6381
"LogicNode",
6482
"DoneNode",
6583
"CustomReworkNode",
84+
"AutoQANode",
6685
"UnknownWorkflowNode",
6786
"WorkflowEdge",
6887
"WorkflowEdgeFactory",
6988
"ProjectWorkflow",
89+
"NodeType",
7090
"ProjectWorkflowGraph",
7191
"ProjectWorkflowFilter",
92+
# Fluent DSL exports
93+
"created_by",
94+
"labeled_by",
95+
"annotation",
96+
"sample",
97+
"dataset",
98+
"batch",
99+
"issue_category",
100+
"model_prediction",
101+
"natural_language",
102+
"labeled_at",
103+
"labeling_time",
104+
"review_time",
105+
"consensus_average",
106+
"feature_consensus_average",
107+
"metadata",
108+
"condition",
109+
# Utility functions
110+
"convert_to_api_format",
72111
]
73112

74113
# Define a mapping of node types for backward compatibility
@@ -80,5 +119,6 @@
80119
WorkflowDefinitionId.Logic: LogicNode,
81120
WorkflowDefinitionId.Done: DoneNode,
82121
WorkflowDefinitionId.CustomReworkTask: CustomReworkNode,
122+
WorkflowDefinitionId.AutoQA: AutoQANode,
83123
WorkflowDefinitionId.Unknown: UnknownWorkflowNode,
84124
}

0 commit comments

Comments
 (0)