Coverage for src/kwai/modules/training/teams/team_query.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2024-01-01 00:00 +0000

1"""Module that defines an interface for a team query.""" 

2 

3from abc import ABC, abstractmethod 

4 

5from kwai.core.domain.repository.query import Query 

6from kwai.modules.training.teams.team import TeamIdentifier 

7 

8 

9class TeamQuery(Query, ABC): 

10 """Interface for a team query.""" 

11 

12 @abstractmethod 

13 def filter_by_id(self, id_: TeamIdentifier) -> "TeamQuery": 

14 """Add a filter for a given id. 

15 

16 Args: 

17 id_: A team id. 

18 """ 

19 raise NotImplementedError 

20 

21 @abstractmethod 

22 def filter_by_ids(self, *id_: TeamIdentifier) -> "TeamQuery": 

23 """Add a filter on one or more team identifiers. 

24 

25 Args: 

26 id_: one or more ids of a team. 

27 """ 

28 raise NotImplementedError