Skip to content

Commit 98aa7a8

Browse files
committed
chore: do not add _Unset as type but instead ignore the mypy error for now
1 parent 536c27b commit 98aa7a8

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

otterdog/models/repository.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
UNSET,
2929
Change,
3030
IndentingPrinter,
31-
_Unset,
3231
associate_by_key,
3332
is_set_and_present,
3433
is_set_and_valid,
@@ -108,7 +107,7 @@ class Repository(ModelObject):
108107
fork_default_branch_only: bool = dataclasses.field(metadata={"model_only": True})
109108

110109
workflows: RepositoryWorkflowSettings = dataclasses.field(metadata={"embedded_model": True})
111-
team_permissions: dict[str, str] | None | _Unset
110+
team_permissions: dict[str, str] | None
112111

113112
# model only fields
114113
aliases: list[str] = dataclasses.field(metadata={"model_only": True}, default_factory=list)
@@ -266,7 +265,9 @@ def set_team_permissions(self, permissions: dict[str, str]) -> None:
266265
}
267266

268267
def unset_team_permissions(self) -> None:
269-
self.team_permissions = UNSET
268+
# we explicitly set the team_permissions to UNSET to mark that this property shall not be used
269+
# ignore type checking here as we do not explicitly add the UNSET type yet for all properties
270+
self.team_permissions = UNSET # type: ignore
270271

271272
def coerce_from_org_settings(self, org_settings: OrganizationSettings, for_patch: bool = False) -> Repository:
272273
copy = dataclasses.replace(self)

0 commit comments

Comments
 (0)