Skip to content

Commit 6520316

Browse files
committed
Fix types
1 parent b1966b2 commit 6520316

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

libs/labelbox/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ dev-dependencies = [
6969
"types-python-dateutil>=2.9.0.20240316",
7070
"types-requests>=2.31.0.20240311",
7171
"types-tqdm>=4.66.0.20240106",
72+
"types-PyYAML>=6.0.12.20240311",
7273
]
7374

7475
[tool.ruff]

libs/labelbox/src/labelbox/alignerr/schema/project_domain.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import List, Optional
1+
from typing import List, Optional, Dict, Any
22
from labelbox.orm.db_object import Deletable, DbObject
33
from labelbox.orm.model import Field
44
from labelbox.pagination import PaginatedCollection
@@ -212,7 +212,10 @@ def get_by_project_id(
212212
project_id, limit, offset, include_archived
213213
)
214214

215-
params = {"projectId": project_id, "includeArchived": include_archived}
215+
params: Dict[str, Any] = {
216+
"projectId": project_id,
217+
"includeArchived": include_archived,
218+
}
216219

217220
return PaginatedCollection(
218221
client=client,
@@ -268,12 +271,18 @@ def search(
268271
}
269272
}"""
270273

271-
params = {
274+
# Build params dictionary with proper types for GraphQL
275+
params: Dict[str, Any] = {
272276
"includeArchived": include_archived,
273-
"searchByName": search_by_name,
274-
"projectIds": project_ids,
275277
}
276278

279+
# Only add non-None values to avoid type issues
280+
if search_by_name is not None:
281+
params["searchByName"] = search_by_name
282+
if project_ids is not None:
283+
# Keep as list for GraphQL - it will be properly serialized
284+
params["projectIds"] = project_ids
285+
277286
return PaginatedCollection(
278287
client=client,
279288
query=query_str,

0 commit comments

Comments
 (0)