Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 16, 2024
1 parent 1b96540 commit 3a87832
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
24 changes: 8 additions & 16 deletions src/argilla_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,11 @@ def __iter__(self):

@overload
@abstractmethod
def __getitem__(self, index: int) -> "User":
...
def __getitem__(self, index: int) -> "User": ...

@overload
@abstractmethod
def __getitem__(self, index: slice) -> Sequence["User"]:
...
def __getitem__(self, index: slice) -> Sequence["User"]: ...

def __getitem__(self, index):
model = self._api.list()[index]
Expand All @@ -150,12 +148,10 @@ def add(self, user: "User") -> "User":
return user.create()

@overload
def list(self) -> List["User"]:
...
def list(self) -> List["User"]: ...

@overload
def list(self, workspace: "Workspace") -> List["User"]:
...
def list(self, workspace: "Workspace") -> List["User"]: ...

def list(self, workspace: Optional["Workspace"] = None) -> List["User"]:
"""List all users."""
Expand Down Expand Up @@ -207,13 +203,11 @@ def __iter__(self):

@overload
@abstractmethod
def __getitem__(self, index: int) -> "Workspace":
...
def __getitem__(self, index: int) -> "Workspace": ...

@overload
@abstractmethod
def __getitem__(self, index: slice) -> Sequence["Workspace"]:
...
def __getitem__(self, index: slice) -> Sequence["Workspace"]: ...

def __getitem__(self, index) -> "Workspace":
model = self._api.list()[index]
Expand Down Expand Up @@ -287,13 +281,11 @@ def __iter__(self):

@overload
@abstractmethod
def __getitem__(self, index: int) -> "Dataset":
...
def __getitem__(self, index: int) -> "Dataset": ...

@overload
@abstractmethod
def __getitem__(self, index: slice) -> Sequence["Dataset"]:
...
def __getitem__(self, index: slice) -> Sequence["Dataset"]: ...

def __getitem__(self, index) -> "Dataset":
model = self._api.list()[index]
Expand Down
12 changes: 4 additions & 8 deletions src/argilla_sdk/workspaces/_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,25 +147,21 @@ def __init__(self, workspace: "Workspace") -> None:
self._workspace = workspace

@overload
def add(self, user: "User") -> "User":
...
def add(self, user: "User") -> "User": ...

@overload
def add(self, user: str) -> "User":
...
def add(self, user: str) -> "User": ...

def add(self, user: Union["User", str]) -> "User":
if isinstance(user, str):
return self._add_user_by_username(username=user)
return user.add_to_workspace(workspace=self._workspace)

@overload
def delete(self, user: "User") -> "User":
...
def delete(self, user: "User") -> "User": ...

@overload
def delete(self, user: str) -> "User":
...
def delete(self, user: str) -> "User": ...

def delete(self, user: Union["User", str]) -> "User":
if isinstance(user, str):
Expand Down

0 comments on commit 3a87832

Please sign in to comment.