Skip to content

Commit bee3924

Browse files
author
Val Brodsky
committed
Fix lint issues
1 parent 0a407e6 commit bee3924

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

libs/labelbox/src/labelbox/schema/labeling_service_dashboard.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,17 @@ class LabelingServiceDashboard(_CamelCaseMixin):
7171
created_at: Optional[datetime] = Field(frozen=True, default=None)
7272
updated_at: Optional[datetime] = Field(frozen=True, default=None)
7373
created_by_id: Optional[str] = Field(frozen=True, default=None)
74-
status: LabelingServiceStatus = Field(frozen=True, default=None)
74+
status: Optional[LabelingServiceStatus] = Field(frozen=True, default=None)
7575
data_rows_count: int = Field(frozen=True)
7676
tasks_completed_count: int = Field(frozen=True)
7777
tasks_remaining_count: Optional[int] = Field(frozen=True, default=None)
7878
media_type: Optional[MediaType] = Field(frozen=True, default=None)
79-
editor_task_type: EditorTaskType = Field(frozen=True, default=None)
80-
tags: List[LabelingServiceDashboardTags] = Field(frozen=True, default=None)
79+
editor_task_type: Optional[EditorTaskType] = Field(
80+
frozen=True, default=None
81+
)
82+
tags: Optional[List[LabelingServiceDashboardTags]] = Field(
83+
frozen=True, default=None
84+
)
8185

8286
client: Any # type Any to avoid circular import from client
8387

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class UIMode(Enum):
6666
options: List["Option"] = field(default_factory=list)
6767
schema_id: Optional[str] = None
6868
feature_schema_id: Optional[str] = None
69-
scope: Scope = None
69+
scope: Optional[Scope] = None
7070
ui_mode: Optional[UIMode] = (
7171
None # How this classification should be answered (e.g. hotkeys / autocomplete, etc)
7272
)
@@ -203,7 +203,7 @@ def add_option(
203203
f"Duplicate nested classification '{option.name}' "
204204
f"for option '{self.label}'"
205205
)
206-
self.options.append(option)
206+
self.options.append(option) # type: ignore
207207

208208

209209
@dataclass
@@ -305,7 +305,7 @@ def asdict(self, is_subclass: bool = False) -> Dict[str, Any]:
305305
raise InconsistentOntologyException(
306306
f"Response Classification '{self.name}' requires options."
307307
)
308-
classification = {
308+
classification: Dict[str, Any] = {
309309
"type": self.class_type.value,
310310
"instructions": self.instructions,
311311
"name": self.name,
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
from typing import Annotated, Type
1+
from typing import Annotated
22

3-
from pydantic import StringConstraints
3+
from pydantic import Field
44

5-
FeatureSchemaId: Type[str] = Annotated[
6-
str, StringConstraints(min_length=25, max_length=25)
7-
]
8-
SchemaId: Type[str] = Annotated[
9-
str, StringConstraints(min_length=25, max_length=25)
10-
]
5+
FeatureSchemaId = Annotated[str, Field(min_length=25, max_length=25)]
6+
SchemaId = Annotated[str, Field(min_length=25, max_length=25)]

libs/labelbox/tests/integration/test_chat_evaluation_ontology_project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_create_chat_evaluation_ontology_project(
1515
# here we are essentially testing the ontology creation which is a fixture
1616
assert ontology
1717
assert ontology.name
18-
assert len(ontology.tools()) == 5
18+
assert len(ontology.tools()) == 6
1919
for tool in ontology.tools():
2020
assert tool.schema_id
2121
assert tool.feature_schema_id

libs/labelbox/tests/unit/test_unit_fact_checking_tool.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ def test_fact_checking_as_dict_default():
4545

4646
def test_step_reasoning_as_dict_with_actions():
4747
tool = FactCheckingTool(name="Fact Checking Tool")
48-
tool.set_unsupported_step_actions([])
49-
tool.set_cant_confidently_assess_step_actions([])
50-
tool.set_no_factual_information_step_actions([])
48+
for variant in tool.definition.variants:
49+
variant.set_actions([])
5150

5251
# Get the dictionary representation
5352
tool_dict = tool.asdict()
@@ -59,11 +58,12 @@ def test_step_reasoning_as_dict_with_actions():
5958
"required": False,
6059
"schemaNodeId": None,
6160
"featureSchemaId": None,
61+
"color": None,
6262
"definition": {
6363
"variants": [
64-
{"id": 0, "name": "Accurate"},
65-
{"id": 1, "name": "Inaccurate"},
66-
{"id": 2, "name": "Disputed"},
64+
{"id": 0, "name": "Accurate", "actions": []},
65+
{"id": 1, "name": "Inaccurate", "actions": []},
66+
{"id": 2, "name": "Disputed", "actions": []},
6767
{
6868
"id": 3,
6969
"name": "Unsupported",

0 commit comments

Comments
 (0)