Coverage for src/kwai/modules/training/coaches/coach_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 coach query.""" 

2 

3from abc import ABC, abstractmethod 

4 

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

6from kwai.modules.training.coaches.coach import CoachIdentifier 

7 

8 

9class CoachQuery(Query, ABC): 

10 """Interface for a coach query.""" 

11 

12 @abstractmethod 

13 def filter_by_id(self, id_: CoachIdentifier) -> "CoachQuery": 

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

15 

16 Args: 

17 id_: A coach id. 

18 """ 

19 raise NotImplementedError 

20 

21 @abstractmethod 

22 def filter_by_ids(self, *id_: CoachIdentifier) -> "CoachQuery": 

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

24 

25 Args: 

26 id_: one or more ids of a coach. 

27 """ 

28 raise NotImplementedError 

29 

30 @abstractmethod 

31 def filter_by_active(self) -> "CoachQuery": 

32 """Add a filter for the active coaches.""" 

33 raise NotImplementedError