mlm_insights.tests.selectors package

Subpackages

Submodules

mlm_insights.tests.selectors.dataset_metric_selector module

class mlm_insights.tests.selectors.dataset_metric_selector.DatasetMetricSelector(profile_source: ProfileSource, metric_key: str)

Bases: SelectorBase

DatasetMetricSelector is a selection technique which use Insights profile as source. User can query metric data by using metric key.`metric key` is available in json view of Profile.

Configuration

profile_source : ProfileSource Specify whether the source is current profile or reference profile

metric_key: str Metric key for given dataset metric, Use Metric key according to Json view of insights profile.

metric_key: str
profile_source: ProfileSource
query(test_context: TestContext, *args: Any, **kwargs: Any) SelectorResult

This method query the metric data from the Insight Profile.

Parameters

test_contextTestContext

Must be ProfileTestContext.

Returns

SelectorResult

validate(test_context: TestContext, *args: Any, **kwargs: Any) SelectorValidationResult

Validate if all the configuration is valid or not

Parameters

test_contextTestContext

ProfileTestContext

Returns

ValidationResult

mlm_insights.tests.selectors.feature_metric_selector module

class mlm_insights.tests.selectors.feature_metric_selector.FeatureMetricSelector(profile_source: ProfileSource, feature_name: str, metric_key: str)

Bases: SelectorBase

FeatureMetricSelector is a selection technique which use Insights profile as source. User can query metric data by using feature_name and metric key.`metric key` is available in json view of Profile.

Configuration

profile_source : ProfileSource Specify whether the source is current profile or reference profile

feature_name: str Name of the feature.

metric_key: str Metric key for given feature, Use Metric key according to Json view of insights profile.

feature_name: str
metric_key: str
profile_source: ProfileSource
query(test_context: TestContext, *args: Any, **kwargs: Any) SelectorResult

This method query the metric data from the Insight Profile.

Parameters

test_contextTestContext

Must be ProfileTestContext.

Returns

SelectorResult

validate(test_context: TestContext, *args: Any, **kwargs: Any) SelectorValidationResult

Validate if all the configuration is valid or nod

Parameters

test_contextTestContext

ProfileTestContext

Returns

ValidationResult

mlm_insights.tests.selectors.selector_result module

class mlm_insights.tests.selectors.selector_result.SelectorResult(value: int | str | float | bool | ~typing.List[~typing.Any] | ~typing.Tuple[int, int], description: str = '', tags: ~typing.Dict[str, ~typing.Any] = <factory>)

Bases: object

SelectorResult contains the metric result that is produce by a Selector

description: str = ''

Selector tags

tags: Dict[str, Any]
value: int | str | float | bool | List[Any] | Tuple[int, int]

Description of the selector

mlm_insights.tests.selectors.selector_validation_result module

class mlm_insights.tests.selectors.selector_validation_result.SelectorValidationResult(valid: bool, errors: ~typing.List[str] = <factory>)

Bases: object

ValidationResult tells if a Validation done by a Selector is valid or not. Selector must set valid = True, if validation succeeded. If validation fails, it should set valid = False and additionally it also set the list of errors

errors: List[str]
is_valid() bool

Returns

Return if this validation succeeded or failed.

valid: bool

Module contents