Skip to content

Commit

Permalink
fix: remove ipython and html type from client
Browse files Browse the repository at this point in the history
  • Loading branch information
burtenshaw committed Jun 11, 2024
1 parent ebbf0b3 commit 9e348f4
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions argilla-sdk/src/argilla_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from argilla_sdk import Dataset
from argilla_sdk import User

from IPython.display import HTML

__all__ = ["Argilla"]

Expand Down Expand Up @@ -122,13 +121,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 +147,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 All @@ -170,7 +165,7 @@ def list(self, workspace: Optional["Workspace"] = None) -> List["User"]:
# Private methods
############################

def _repr_html_(self) -> "HTML":
def _repr_html_(self) -> str:
return self._represent_as_html(resources=self.list())

def _from_model(self, model: UserModel) -> "User":
Expand Down Expand Up @@ -207,13 +202,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 @@ -249,7 +242,7 @@ def default(self) -> "Workspace":
# Private methods
############################

def _repr_html_(self) -> "HTML":
def _repr_html_(self) -> str:
return self._represent_as_html(resources=self.list())

def _from_model(self, model: WorkspaceModel) -> "Workspace":
Expand Down Expand Up @@ -287,13 +280,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 Expand Up @@ -324,7 +315,7 @@ def list(self) -> List["Dataset"]:
# Private methods
############################

def _repr_html_(self) -> "HTML":
def _repr_html_(self) -> str:
return self._represent_as_html(resources=self.list())

def _from_model(self, model: DatasetModel) -> "Dataset":
Expand Down

0 comments on commit 9e348f4

Please sign in to comment.