great_expectations.experimental.datasources.sources

Module Contents

Classes

_SourceFactories(data_context: Union[DataContext, GXDataContext])

Contains a collection of datasource factory methods in the format .add_<TYPE_NAME>()

great_expectations.experimental.datasources.sources.SourceFactoryFn
great_expectations.experimental.datasources.sources.LOGGER
exception great_expectations.experimental.datasources.sources.TypeRegistrationError

Bases: TypeError

Inappropriate argument type.

class great_expectations.experimental.datasources.sources._SourceFactories(data_context: Union[DataContext, GXDataContext])

Contains a collection of datasource factory methods in the format .add_<TYPE_NAME>()

Contains a .type_lookup dict-like two way mapping between previously registered Datasource or DataAsset types and a simplified name for those types.

type_lookup :ClassVar
__source_factories :ClassVar[Dict[str, SourceFactoryFn]]
_data_context :Union[DataContext, GXDataContext]
classmethod register_types_and_ds_factory(cls, ds_type: Type[Datasource], factory_fn: SourceFactoryFn)

Add/Register a datasource factory function and all related Datasource, DataAsset and ExecutionEngine types.

Creates mapping table between the DataSource/DataAsset classes and their declared type string.

Example

An .add_pandas() pandas factory method will be added to context.sources.

>>> class PandasDatasource(Datasource):
>>>     type: str = 'pandas'`
>>>     asset_types = [FileAsset]
>>>     execution_engine: PandasExecutionEngine
classmethod _register_datasource_and_factory_method(cls, ds_type: Type[Datasource], factory_fn: SourceFactoryFn, ds_type_name: str, datasource_type_lookup: TypeLookup)

Register the Datasource class and add a factory method for the class on sources. The method name is pulled from the Datasource.type attribute.

classmethod _register_assets(cls, ds_type: Type[Datasource], asset_type_lookup: TypeLookup)
property factories(self)
__getattr__(self, attr_name: str)
__dir__(self)

Preserves autocompletion for dynamic attributes.