Skip to content

Commit ee7809b

Browse files
update precommit hook
1 parent e0be91f commit ee7809b

File tree

9 files changed

+19
-34
lines changed

9 files changed

+19
-34
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/google/yapf
3-
rev: v0.33.0
3+
rev: v0.44.0
44
hooks:
55
- id: yapf
66
name: "yapf"

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Changelog
22
# Version 3.48.0 (2023-06-13)
33
## Added
4-
* Support for ISO format to exports V2 date filters
4+
* Support for ISO format to exports V2 date filters
55
* Support to specify confidence for all free-text annotations
66

77
## Changed

labelbox/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ def _create(self, db_object_type, data):
547547
# Also convert Labelbox object values to their UIDs.
548548
data = {
549549
db_object_type.attribute(attr) if isinstance(attr, str) else attr:
550-
value.uid if isinstance(value, DbObject) else value
550+
value.uid if isinstance(value, DbObject) else value
551551
for attr, value in data.items()
552552
}
553553

labelbox/data/serialization/labelbox_v1/objects.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,7 @@ def from_common(cls, mask: Mask,
225225
classifications=classifications,
226226
schema_id=feature_schema_id,
227227
title=title,
228-
**{
229-
k: v for k, v in extra.items() if k != 'instanceURI'
230-
})
228+
**{k: v for k, v in extra.items() if k != 'instanceURI'})
231229

232230

233231
class _TextPoint(BaseModel):
@@ -264,18 +262,9 @@ def from_common(cls, text_entity: TextEntity,
264262

265263

266264
class LBV1Objects(BaseModel):
267-
objects: List[Union[
268-
LBV1Line,
269-
LBV1Point,
270-
LBV1Polygon,
271-
LBV1Rectangle,
272-
LBV1TextEntity,
273-
LBV1Mask,
274-
LBV1TIPoint,
275-
LBV1TILine,
276-
LBV1TIPolygon,
277-
LBV1TIRectangle,
278-
]]
265+
objects: List[Union[LBV1Line, LBV1Point, LBV1Polygon, LBV1Rectangle,
266+
LBV1TextEntity, LBV1Mask, LBV1TIPoint, LBV1TILine,
267+
LBV1TIPolygon, LBV1TIRectangle,]]
279268

280269
def to_common(self) -> List[ObjectAnnotation]:
281270
objects = [

labelbox/data/serialization/ndjson/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ class NDAnnotation(NDJsonBase):
4444

4545
@root_validator()
4646
def must_set_one(cls, values):
47-
if ('schema_id' not in values or values['schema_id']
48-
is None) and ('name' not in values or values['name'] is None):
47+
if ('schema_id' not in values or
48+
values['schema_id'] is None) and ('name' not in values or
49+
values['name'] is None):
4950
raise ValueError("Schema id or name are not set. Set either one.")
5051
return values
5152

labelbox/data/serialization/ndjson/classification.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ class NDAnswer(ConfidenceMixin):
1919

2020
@root_validator()
2121
def must_set_one(cls, values):
22-
if ('schema_id' not in values or values['schema_id']
23-
is None) and ('name' not in values or values['name'] is None):
22+
if ('schema_id' not in values or
23+
values['schema_id'] is None) and ('name' not in values or
24+
values['name'] is None):
2425
raise ValueError("Schema id or name are not set. Set either one.")
2526
return values
2627

labelbox/schema/bulk_import_request.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -901,12 +901,7 @@ class NDMask(NDBaseTool):
901901
class NDTool(
902902
SpecialUnion,
903903
Type[Union[ # type: ignore
904-
NDMask,
905-
NDTextEntity,
906-
NDPoint,
907-
NDRectangle,
908-
NDPolyline,
909-
NDPolygon,
904+
NDMask, NDTextEntity, NDPoint, NDRectangle, NDPolyline, NDPolygon,
910905
]]):
911906
...
912907

labelbox/schema/organization.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,8 @@ def invite_limit(self) -> InviteLimit:
112112
"""query InvitesLimitPyApi($%s: ID!) {
113113
invitesLimit(where: {id: $%s}) { used limit remaining }
114114
}""" % (org_id_param, org_id_param), {org_id_param: self.uid})
115-
return InviteLimit(**{
116-
utils.snake_case(k): v for k, v in res['invitesLimit'].items()
117-
})
115+
return InviteLimit(
116+
**{utils.snake_case(k): v for k, v in res['invitesLimit'].items()})
118117

119118
def remove_user(self, user: "User") -> None:
120119
"""

labelbox/schema/project.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,9 +609,9 @@ def create_labeler_performance(client, result):
609609
# python isoformat doesn't accept Z as utc timezone
610610
result["lastActivityTime"] = datetime.fromisoformat(
611611
result["lastActivityTime"].replace('Z', '+00:00'))
612-
return LabelerPerformance(**{
613-
utils.snake_case(key): value for key, value in result.items()
614-
})
612+
return LabelerPerformance(
613+
**
614+
{utils.snake_case(key): value for key, value in result.items()})
615615

616616
return PaginatedCollection(self.client, query_str, {id_param: self.uid},
617617
["project", "labelerPerformance"],

0 commit comments

Comments
 (0)