Coverage for kwai/modules/training/teams/team_tables.py: 100%
10 statements
« prev ^ index » next coverage.py v7.3.0, created at 2023-09-05 17:55 +0000
« prev ^ index » next coverage.py v7.3.0, created at 2023-09-05 17:55 +0000
1"""Module that defines all dataclasses for the team tables."""
2from dataclasses import dataclass
4from kwai.core.db.table import Table
5from kwai.modules.training.teams.team import TeamEntity, TeamIdentifier
8@dataclass(kw_only=True, frozen=True, slots=True)
9class TeamRow:
10 """Represent a row of the teams table."""
12 id: int
13 name: str
15 def create_entity(self) -> TeamEntity:
16 """Create a Team entity of this row."""
17 return TeamEntity(id_=TeamIdentifier(self.id), name=self.name)
20TeamsTable = Table("teams", TeamRow)