Coverage for src/kwai/modules/training/teams/team_tables.py: 100%
10 statements
« prev ^ index » next coverage.py v7.6.10, created at 2024-01-01 00:00 +0000
« prev ^ index » next coverage.py v7.6.10, created at 2024-01-01 00:00 +0000
1"""Module that defines all dataclasses for the team tables."""
3from dataclasses import dataclass
5from kwai.core.db.table import Table
6from kwai.modules.training.teams.team import TeamEntity, TeamIdentifier
9@dataclass(kw_only=True, frozen=True, slots=True)
10class TeamRow:
11 """Represent a row of the teams table."""
13 id: int
14 name: str
16 def create_entity(self) -> TeamEntity:
17 """Create a Team entity of this row."""
18 return TeamEntity(id_=TeamIdentifier(self.id), name=self.name)
21TeamsTable = Table("teams", TeamRow)