Skip to main content
Version: 1.3.7

DatabricksSQLDatasource

Signature

class great_expectations.datasource.fluent.DatabricksSQLDatasource(*, type: Literal['databricks_sql'] = 'databricks_sql', name: str, id: Optional[uuid.UUID] = None, assets: List[Union[great_expectations.datasource.fluent.sql_datasource.TableAsset, great_expectations.datasource.fluent.sql_datasource.QueryAsset]] = [], connection_string: Union[great_expectations.datasource.fluent.config_str.ConfigStr, great_expectations.datasource.fluent.databricks_sql_datasource.DatabricksDsn], create_temp_table: bool = False, kwargs: Dict[str, Union[great_expectations.datasource.fluent.config_str.ConfigStr, Any]] = {})

Adds a DatabricksSQLDatasource to the data context.

Parameters

NameDescription

name

The name of this DatabricksSQL datasource.

Methods

Signature

add_query_asset(name: str, query: str, batch_metadata: Optional[BatchMetadata] = None) → QueryAsset

Adds a query asset to this datasource.

Parameters

NameDescription

name

The name of this table asset.

Returns

TypeDescription

QueryAsset

The query asset that is added to the datasource. The type of this object will match the necessary type for this datasource. eg, it could be a QueryAsset or a SqliteQueryAsset.

Signature

add_table_asset(name: str, table_name: str = '', schema_name: Optional[str] = None, batch_metadata: Optional[BatchMetadata] = None) → TableAsset

Adds a table asset to this datasource.

Parameters

NameDescription

name

The name of this table asset.

Returns

TypeDescription

TableAsset

The table asset that is added to the datasource. The type of this object will match the necessary type for this datasource. eg, it could be a TableAsset or a SqliteTableAsset.

Signature

delete_asset(name: str)None

Removes the DataAsset referred to by asset_name from internal list of available DataAsset objects.

Parameters

NameDescription

name

name of DataAsset to be deleted.

Signature

get_asset(name: str) → great_expectations.datasource.fluent.interfaces._DataAssetT

Returns the DataAsset referred to by asset_name

Parameters

NameDescription

name

name of DataAsset sought.

Returns

TypeDescription

great_expectations.datasource.fluent.interfaces._DataAssetT

if named "DataAsset" object exists; otherwise, exception is raised.