great_expectations.rule_based_profiler.rule

Package Contents

Classes

Rule(name: str, domain_builder: DomainBuilder, expectation_configuration_builders: List[ExpectationConfigurationBuilder], parameter_builders: Optional[List[ParameterBuilder]] = None)

A convenience class for migrating away from untyped dictionaries to stronger typed objects.

class great_expectations.rule_based_profiler.rule.Rule(name: str, domain_builder: DomainBuilder, expectation_configuration_builders: List[ExpectationConfigurationBuilder], parameter_builders: Optional[List[ParameterBuilder]] = None)

Bases: great_expectations.types.SerializableDictDot

A convenience class for migrating away from untyped dictionaries to stronger typed objects.

Can be instantiated with arguments:

my_A = MyClassA(

foo=”a string”, bar=1,

)

Can be instantiated from a dictionary:

my_A = MyClassA(
**{

“foo”: “a string”, “bar”: 1,

}

)

Can be accessed using both dictionary and dot notation

my_A.foo == “a string” my_A.bar == 1

my_A[“foo”] == “a string” my_A[“bar”] == 1

Pairs nicely with @dataclass:

@dataclass() class MyClassA(DictDot):

foo: str bar: int

Can be made immutable:

@dataclass(frozen=True) class MyClassA(DictDot):

foo: str bar: int

For more examples of usage, please see test_dataclass_serializable_dot_dict_pattern.py in the tests folder.

generate(self, variables: Optional[ParameterContainer] = None)

Builds a list of Expectation Configurations, returning a single Expectation Configuration entry for every ConfigurationBuilder available based on the instantiation.

Returns

List of Corresponding Expectation Configurations representing every configured rule

to_dict(self)
to_json_dict(self)

# TODO: <Alex>2/4/2022</Alex> This implementation of “SerializableDictDot.to_json_dict() occurs frequently and should ideally serve as the reference implementation in the “SerializableDictDot” class itself. However, the circular import dependencies, due to the location of the “great_expectations/types/__init__.py” and “great_expectations/core/util.py” modules make this refactoring infeasible at the present time.

__repr__(self)

# TODO: <Alex>2/4/2022</Alex> This implementation of a custom “__repr__()” occurs frequently and should ideally serve as the reference implementation in the “SerializableDictDot” class. However, the circular import dependencies, due to the location of the “great_expectations/types/__init__.py” and “great_expectations/core/util.py” modules make this refactoring infeasible at the present time.

__str__(self)

# TODO: <Alex>2/4/2022</Alex> This implementation of a custom “__str__()” occurs frequently and should ideally serve as the reference implementation in the “SerializableDictDot” class. However, the circular import dependencies, due to the location of the “great_expectations/types/__init__.py” and “great_expectations/core/util.py” modules make this refactoring infeasible at the present time.

property name(self)
_get_parameter_builders_as_dict(self)
_get_expectation_configuration_builders_as_dict(self)
property domain_builder(self)
property parameter_builders(self)
property expectation_configuration_builders(self)
property parameters(self)