Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add email in User model #1062

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.min.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ nltk==3.6.7
scipy==1.10.0
requests==2.31.0
PyYAML==5.4
pydantic==1.10.14
pydantic==1.10.12
litestar==2.5.1
typing-inspect==0.9.0
uvicorn==0.22.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"scipy>=1.10.0",
"requests>=2.31.0",
"PyYAML>=5.4",
"pydantic>=1.10.14",
"pydantic>=1.10.12",
"litestar>=2.6.3",
"typing-inspect>=0.9.0",
"uvicorn>=0.22.0",
Expand Down
3 changes: 2 additions & 1 deletion src/evidently/ui/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def from_team(cls, team: Team):
class UserModel(BaseModel):
id: UserID
name: str
email: str

@classmethod
def from_user(cls, user: User):
return TeamModel(id=user.id, name=user.name)
return UserModel(id=user.id, name=user.name, email=user.email)
5 changes: 3 additions & 2 deletions src/evidently/ui/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class Team(BaseModel):
class User(BaseModel):
id: UserID = Field(default_factory=uuid.uuid4)
name: str
email: str = ""


def _default_dashboard():
Expand Down Expand Up @@ -406,10 +407,10 @@ def delete_team(self, user_id: UserID, team_id: TeamID):
self._delete_team(team_id)

@abstractmethod
def _list_team_users(self, team_id: TeamID) -> List[User]:
def _list_team_users(self, team_id: TeamID) -> List[UserID]:
raise NotImplementedError

def list_team_users(self, user_id: UserID, team_id: TeamID) -> List[User]:
def list_team_users(self, user_id: UserID, team_id: TeamID) -> List[UserID]:
if not self.check_team_permission(user_id, team_id, TeamPermission.READ):
raise TeamNotFound()
return self._list_team_users(team_id)
Expand Down
2 changes: 1 addition & 1 deletion src/evidently/ui/storage/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _list_user_teams(self, user_id: UserID, include_virtual: bool) -> List[Team]
def _delete_team(self, team_id: TeamID):
pass

def _list_team_users(self, team_id: TeamID) -> List[User]:
def _list_team_users(self, team_id: TeamID) -> List[UserID]:
return []


Expand Down
Loading