def _build_asset_from_config(self, config: dict):
     runtime_environment: dict = {"data_connector": self}
     config = assetConfigSchema.load(config)
     config = assetConfigSchema.dump(config)
     asset: Asset = instantiate_class_from_config(
         config=config,
         runtime_environment=runtime_environment,
         config_defaults={},
     )
     if not asset:
         raise ge_exceptions.ClassInstantiationError(
             module_name="great_expectations.datasource.data_connector.asset",
             package_name=None,
             class_name=config["class_name"],
         )
     return asset
Exemplo n.º 2
0
def _build_asset_from_config(runtime_environment: "DataConnector",
                             config: dict) -> Asset:
    """Build Asset from configuration and return asset. Used by both ConfiguredAssetDataConnector and RuntimeDataConnector"""
    runtime_environment: dict = {"data_connector": runtime_environment}
    config = assetConfigSchema.load(config)
    config = assetConfigSchema.dump(config)
    asset: Asset = instantiate_class_from_config(
        config=config,
        runtime_environment=runtime_environment,
        config_defaults={},
    )
    if not asset:
        raise ge_exceptions.ClassInstantiationError(
            module_name="great_expectations.datasource.data_connector.asset",
            package_name=None,
            class_name=config["class_name"],
        )
    return asset