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
« 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."""
3from abc import ABC, abstractmethod
5from kwai.core.domain.repository.query import Query
6from kwai.modules.training.coaches.coach import CoachIdentifier
9class CoachQuery(Query, ABC):
10 """Interface for a coach query."""
12 @abstractmethod
13 def filter_by_id(self, id_: CoachIdentifier) -> "CoachQuery":
14 """Add a filter for a given id.
16 Args:
17 id_: A coach id.
18 """
19 raise NotImplementedError
21 @abstractmethod
22 def filter_by_ids(self, *id_: CoachIdentifier) -> "CoachQuery":
23 """Add a filter on one or more coach identifiers.
25 Args:
26 id_: one or more ids of a coach.
27 """
28 raise NotImplementedError
30 @abstractmethod
31 def filter_by_active(self) -> "CoachQuery":
32 """Add a filter for the active coaches."""
33 raise NotImplementedError