great_expectations.rule_based_profiler.domain_builder.cardinality_checker

Module Contents

Classes

CardinalityLimit()

Helper class that provides a standard way to create an ABC using

RelativeCardinalityLimit()

Helper class that provides a standard way to create an ABC using

AbsoluteCardinalityLimit()

Helper class that provides a standard way to create an ABC using

CardinalityLimitMode()

Preset limits based on unique values (cardinality)

CardinalityChecker(limit_mode: Optional[Union[CardinalityLimitMode, str]] = None, max_unique_values: Optional[int] = None, max_proportion_unique: Optional[float] = None)

Handles cardinality checking given cardinality limit mode and measured value.

class great_expectations.rule_based_profiler.domain_builder.cardinality_checker.CardinalityLimit

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

name :str
class great_expectations.rule_based_profiler.domain_builder.cardinality_checker.RelativeCardinalityLimit

Bases: great_expectations.rule_based_profiler.domain_builder.cardinality_checker.CardinalityLimit

Helper class that provides a standard way to create an ABC using inheritance.

max_proportion_unique :float
metric_name_defining_limit :str = column.unique_proportion
class great_expectations.rule_based_profiler.domain_builder.cardinality_checker.AbsoluteCardinalityLimit

Bases: great_expectations.rule_based_profiler.domain_builder.cardinality_checker.CardinalityLimit

Helper class that provides a standard way to create an ABC using inheritance.

max_unique_values :int
metric_name_defining_limit :str = column.distinct_values.count
class great_expectations.rule_based_profiler.domain_builder.cardinality_checker.CardinalityLimitMode

Bases: enum.Enum

Preset limits based on unique values (cardinality)

Defines relative (ratio) and absolute number of records (table rows) that correspond to each cardinality category.

Used to determine appropriate Expectation configurations based on data.

ZERO
ONE
TWO
VERY_FEW
FEW
SOME
MANY
VERY_MANY
UNIQUE
ABS_10
ABS_100
ABS_1000
ABS_10_000
ABS_100_000
ABS_1_000_000
ABS_10_000_000
ABS_100_000_000
ABS_1_000_000_000
REL_0
REL_001
REL_01
REL_0_1
REL_1
REL_10
REL_25
REL_50
REL_75
ONE_PCT
TEN_PCT
class great_expectations.rule_based_profiler.domain_builder.cardinality_checker.CardinalityChecker(limit_mode: Optional[Union[CardinalityLimitMode, str]] = None, max_unique_values: Optional[int] = None, max_proportion_unique: Optional[float] = None)

Handles cardinality checking given cardinality limit mode and measured value.

This class also validates cardinality limit settings and converts from various types of settings. You can choose one of the attributes listed below to create an instance.

limit_mode

CardinalityLimitMode or string name of the mode defining the maximum allowable cardinality.

max_unique_values

number of max unique rows for a custom cardinality limit.

max_proportion_unique

proportion of unique values for a custom cardinality limit.

SUPPORTED_CARDINALITY_LIMIT_MODE_CLASSES :Tuple[Union[AbsoluteCardinalityLimit, RelativeCardinalityLimit]]
SUPPORTED_CARDINALITY_LIMIT_MODE_STRINGS :Tuple[str]
property limit_mode(self)
cardinality_within_limit(self, metric_value: float)

Determine if the cardinality is within configured limit.

The metric_value supplied should be either a proportion of unique values or number of unique values based on the configured cardinality limit.

Parameters

metric_value – int if number of unique values, float if proportion of unique values.

Returns

boolean of whether the cardinality is within the configured limit

static _validate_metric_value(metric_value: float)
_convert_to_cardinality_mode(self, limit_mode: Optional[Union[CardinalityLimitMode, str]] = None, max_unique_values: Optional[int] = None, max_proportion_unique: Optional[float] = None)
_validate_input_parameters(self, limit_mode: Optional[Union[CardinalityLimitMode, str]] = None, max_unique_values: Optional[int] = None, max_proportion_unique: Optional[int] = None)