great_expectations.types

Package Contents

Classes

ClassConfig(class_name, module_name=None)

Defines information sufficient to identify a class to be (dynamically) loaded for a DataContext.

DictDot()

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

SerializableDictDot()

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

class great_expectations.types.ClassConfig(class_name, module_name=None)

Defines information sufficient to identify a class to be (dynamically) loaded for a DataContext.

property class_name(self)
property module_name(self)
class great_expectations.types.DictDot

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.

__getitem__(self, item)
__setitem__(self, key, value)
__delitem__(self, key)
__contains__(self, key)
__len__(self)
keys(self)
values(self)
items(self)
get(self, key, default_value=None)
to_dict(self)

Convert this object into a standard dictionary, recursively.

This is often convenient for serialization, and in cases where an untyped version of the object is required.

class great_expectations.types.SerializableDictDot

Bases: great_expectations.types.DictDot

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.

abstract to_json_dict(self)