Coverage for kwai/modules/training/trainings/training_definition_query.py: 100%
4 statements
« prev ^ index » next coverage.py v7.3.0, created at 2023-09-05 17:55 +0000
« prev ^ index » next coverage.py v7.3.0, created at 2023-09-05 17:55 +0000
1"""Module that defines an interface for a training definition query."""
4from abc import ABC, abstractmethod
6from kwai.core.domain.repository.query import Query
7from kwai.modules.training.trainings.training_definition import (
8 TrainingDefinitionIdentifier,
9)
12class TrainingDefinitionQuery(Query, ABC):
13 """Interface for a training definition query."""
15 @abstractmethod
16 def filter_by_id(
17 self, id_: TrainingDefinitionIdentifier
18 ) -> "TrainingDefinitionQuery":
19 """Add a filter on the training definition id.
21 Args:
22 id_: id of a training definition
24 Returns:
25 TrainingDefinitionQuery:
26 """
27 raise NotImplementedError
29 @abstractmethod
30 def filter_by_ids(
31 self, *ids: TrainingDefinitionIdentifier
32 ) -> "TrainingDefinitionQuery":
33 """Add a filter on multiple training definition identifiers.
35 Args:
36 ids: a variable list of training definition identifiers
38 Returns:
39 TrainingDefinitionQuery:
40 """
41 raise NotImplementedError