Data Context Module

great_expectations.data_context.get_data_context(context_type, options)

Return a data_context object which exposes options to list datasets and get a dataset from that context. This is a new API in Great Expectations 0.4, and is subject to rapid change.

Parameters:
  • context_type – (string) one of “SqlAlchemy” or “PandasCSV”
  • options – options to be passed to the data context’s connect method.
Returns:

a new DataContext object

great_expectations.data_context.base

class great_expectations.data_context.base.DataContext(options)

Bases: object

A generic DataContext, exposing the base API including constructor with options parameter, list_datasets, and get_dataset.

Warning: this feature is new in v0.4 and may change based on community feedback.

connect(options)
list_datasets()
get_data_set(dataset_name)

great_expectations.data_context.PandasCSVDataContext

A PandasCSVDataContext makes it easy to get a list of files available in the list_datasets method. Its get_dataset method returns a new Pandas dataset with the provided name.

Warning: this feature is new in v0.4 and may change based on community feedback.

class great_expectations.data_context.pandas_context.PandasCSVDataContext(*args, **kwargs)

Bases: great_expectations.data_context.base.DataContext

A PandasCSVDataContext makes it easy to get a list of files available in the list_datasets method. Its get_dataset method returns a new Pandas dataset with the provided name.

Warning: this feature is new in v0.4 and may change based on community feedback.

connect(options)
list_datasets()
get_dataset(dataset_name, *args, **kwargs)
great_expectations.data_context.PandasCSVDataContext.__delattr__

Implement delattr(self, name).

great_expectations.data_context.PandasCSVDataContext.__eq__

Return self==value.

great_expectations.data_context.PandasCSVDataContext.__ge__

Return self>=value.

great_expectations.data_context.PandasCSVDataContext.__getattribute__

Return getattr(self, name).

great_expectations.data_context.PandasCSVDataContext.__gt__

Return self>value.

great_expectations.data_context.PandasCSVDataContext.__hash__

Return hash(self).

great_expectations.data_context.PandasCSVDataContext.__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

great_expectations.data_context.PandasCSVDataContext.__le__

Return self<=value.

great_expectations.data_context.PandasCSVDataContext.__lt__

Return self<value.

great_expectations.data_context.PandasCSVDataContext.__ne__

Return self!=value.

great_expectations.data_context.PandasCSVDataContext.__new__()

Create and return a new object. See help(type) for accurate signature.

great_expectations.data_context.PandasCSVDataContext.__repr__

Return repr(self).

great_expectations.data_context.PandasCSVDataContext.__setattr__

Implement setattr(self, name, value).

great_expectations.data_context.PandasCSVDataContext.__str__

Return str(self).

great_expectations.data_context.PandasCSVDataContext.__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

great_expectations.data_context.SqlAlchemyDataContext

A SqlAlchemyDataContext creates a SQLAlchemy engine and provides a list of tables available in the list_datasets method. Its get_dataset method returns a new SqlAlchemy dataset with the provided name.

Warning: this feature is new in v0.4 and may change based on community feedback.

class great_expectations.data_context.sqlalchemy_context.SqlAlchemyDataContext(*args, **kwargs)

Bases: great_expectations.data_context.base.DataContext

A SqlAlchemyDataContext creates a SQLAlchemy engine and provides a list of tables available in the list_datasets method. Its get_dataset method returns a new SqlAlchemy dataset with the provided name.

Warning: this feature is new in v0.4 and may change based on community feedback.

connect(options)
list_datasets()
get_dataset(dataset_name)
great_expectations.data_context.SqlAlchemyDataContext.__delattr__

Implement delattr(self, name).

great_expectations.data_context.SqlAlchemyDataContext.__eq__

Return self==value.

great_expectations.data_context.SqlAlchemyDataContext.__ge__

Return self>=value.

great_expectations.data_context.SqlAlchemyDataContext.__getattribute__

Return getattr(self, name).

great_expectations.data_context.SqlAlchemyDataContext.__gt__

Return self>value.

great_expectations.data_context.SqlAlchemyDataContext.__hash__

Return hash(self).

great_expectations.data_context.SqlAlchemyDataContext.__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

great_expectations.data_context.SqlAlchemyDataContext.__le__

Return self<=value.

great_expectations.data_context.SqlAlchemyDataContext.__lt__

Return self<value.

great_expectations.data_context.SqlAlchemyDataContext.__ne__

Return self!=value.

great_expectations.data_context.SqlAlchemyDataContext.__new__()

Create and return a new object. See help(type) for accurate signature.

great_expectations.data_context.SqlAlchemyDataContext.__repr__

Return repr(self).

great_expectations.data_context.SqlAlchemyDataContext.__setattr__

Implement setattr(self, name, value).

great_expectations.data_context.SqlAlchemyDataContext.__str__

Return str(self).

great_expectations.data_context.SqlAlchemyDataContext.__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).