great_expectations.rule_based_profiler.rule.rule

Module Contents

Classes

Rule(name: str, variables: Optional[Union[ParameterContainer, Dict[str, Any]]] = None, domain_builder: Optional[DomainBuilder] = None, parameter_builders: Optional[List[ParameterBuilder]] = None, expectation_configuration_builders: Optional[List[ExpectationConfigurationBuilder]] = None)

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

class great_expectations.rule_based_profiler.rule.rule.Rule(name: str, variables: Optional[Union[ParameterContainer, Dict[str, Any]]] = None, domain_builder: Optional[DomainBuilder] = None, parameter_builders: Optional[List[ParameterBuilder]] = None, expectation_configuration_builders: Optional[List[ExpectationConfigurationBuilder]] = 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.

run(self, variables: Optional[ParameterContainer] = None, batch_list: Optional[List[Batch]] = None, batch_request: Optional[Union[BatchRequestBase, dict]] = None, recompute_existing_parameter_values: bool = False, reconciliation_directives: ReconciliationDirectives = DEFAULT_RECONCILATION_DIRECTIVES, rule_state: Optional[RuleState] = None)

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

Parameters
  • variables – Attribute name/value pairs, commonly-used in Builder objects

  • batch_list – Explicit list of Batch objects to supply data at runtime

  • batch_request – Explicit batch_request used to supply data at runtime

  • recompute_existing_parameter_values – If “True”, recompute value if “fully_qualified_parameter_name” exists

  • reconciliation_directives – directives for how each rule component should be overwritten

  • rule_state – holds “Rule” execution state and responds to “execution_time_property_name” (“execution_time”)

Returns

RuleState representing effect of executing Rule

property name(self)
property variables(self)
property domain_builder(self)
property parameter_builders(self)
property expectation_configuration_builders(self)
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.

_get_parameter_builders_as_dict(self)
_get_expectation_configuration_builders_as_dict(self)
_get_rule_domains(self, variables: Optional[ParameterContainer] = None, batch_list: Optional[List[Batch]] = None, batch_request: Optional[Union[BatchRequestBase, dict]] = None, rule_state: Optional[RuleState] = None)