Skip to content

Commit eb16f04

Browse files
committed
Fixed unit tests
1 parent 0e06806 commit eb16f04

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

libs/labelbox/src/labelbox/schema/tool_building/classification.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ def __post_init__(self):
9595

9696
@classmethod
9797
def from_dict(cls, dictionary: Dict[str, Any]) -> "Classification":
98-
print('attributes:')
99-
print(dictionary.get("attributes", None))
10098
return cls(
10199
class_type=Classification.Type(dictionary["type"]),
102100
name=dictionary["name"],
@@ -109,7 +107,7 @@ def from_dict(cls, dictionary: Dict[str, Any]) -> "Classification":
109107
schema_id=dictionary.get("schemaNodeId", None),
110108
feature_schema_id=dictionary.get("featureSchemaId", None),
111109
scope=cls.Scope(dictionary.get("scope", cls.Scope.GLOBAL)),
112-
attributes=FeatureSchemaAttributes(dictionary.get("attributes", None)),
110+
attributes=dictionary.get("attributes", None),
113111
)
114112

115113
def asdict(self, is_subclass: bool = False) -> Dict[str, Any]:

libs/labelbox/tests/integration/test_ontology.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ def feature_schema_cat_normalized(name_for_read):
225225
"name": name_for_read,
226226
"color": "black",
227227
"classifications": [],
228-
"attributes": [] # TODO tkerr: Finish
229228
}
230229

231230

libs/labelbox/tests/unit/test_unit_ontology.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"color": "#FF0000",
1616
"tool": "polygon",
1717
"classifications": [],
18+
"attributes": None
1819
},
1920
{
2021
"schemaNodeId": None,
@@ -24,6 +25,7 @@
2425
"color": "#FF0000",
2526
"tool": "superpixel",
2627
"classifications": [],
28+
"attributes": None
2729
},
2830
{
2931
"schemaNodeId": None,
@@ -32,6 +34,7 @@
3234
"name": "bbox",
3335
"color": "#FF0000",
3436
"tool": "rectangle",
37+
"attributes": None,
3538
"classifications": [
3639
{
3740
"schemaNodeId": None,
@@ -56,6 +59,7 @@
5659
"name": "nested nested text",
5760
"type": "text",
5861
"options": [],
62+
"attributes": None
5963
}
6064
],
6165
},
@@ -67,6 +71,7 @@
6771
"options": [],
6872
},
6973
],
74+
"attributes": None
7075
},
7176
{
7277
"schemaNodeId": None,
@@ -76,6 +81,7 @@
7681
"name": "nested text",
7782
"type": "text",
7883
"options": [],
84+
"attributes": None
7985
},
8086
],
8187
},
@@ -87,6 +93,7 @@
8793
"color": "#FF0000",
8894
"tool": "point",
8995
"classifications": [],
96+
"attributes": None
9097
},
9198
{
9299
"schemaNodeId": None,
@@ -96,6 +103,7 @@
96103
"color": "#FF0000",
97104
"tool": "line",
98105
"classifications": [],
106+
"attributes": None
99107
},
100108
{
101109
"schemaNodeId": None,
@@ -105,6 +113,7 @@
105113
"color": "#FF0000",
106114
"tool": "named-entity",
107115
"classifications": [],
116+
"attributes": None
108117
},
109118
],
110119
"classifications": [
@@ -117,6 +126,7 @@
117126
"type": "radio",
118127
"scope": "global",
119128
"uiMode": "searchable",
129+
"attributes": None,
120130
"options": [
121131
{
122132
"schemaNodeId": None,

libs/labelbox/tests/unit/test_unit_prompt_issue_tool.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def test_as_dict():
4747
"schemaNodeId": None,
4848
"featureSchemaId": None,
4949
"scope": "global",
50+
"attributes": None
5051
}
5152
],
5253
"color": None,

0 commit comments

Comments
 (0)