Coverage for bc/kwai-bc-training/src/kwai_bc_training/coaches/coach_query.py: 100%

5 statements  

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

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

2 

3from abc import ABC, abstractmethod 

4from typing import Self 

5 

6from kwai_core.domain.repository.query import Query 

7 

8from kwai_bc_training.coaches.coach import CoachIdentifier 

9 

10 

11class CoachQuery(Query, ABC): 

12 """Interface for a coach query.""" 

13 

14 @abstractmethod 

15 def filter_by_id(self, id_: CoachIdentifier) -> Self: 

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

17 

18 Args: 

19 id_: A coach id. 

20 """ 

21 raise NotImplementedError 

22 

23 @abstractmethod 

24 def filter_by_ids(self, *id_: CoachIdentifier) -> Self: 

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

26 

27 Args: 

28 id_: one or more ids of a coach. 

29 """ 

30 raise NotImplementedError 

31 

32 @abstractmethod 

33 def filter_by_active(self) -> Self: 

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

35 raise NotImplementedError