Skip to main content
Version: 1.3.3

DirectoryDataAsset

Signature

class great_expectations.datasource.fluent.data_asset.path.directory_asset.DirectoryDataAsset(&amp;42;, name: <pydantic.v1.fields.DeferredType object at 0x7f01a5e702f0>, type: <pydantic.v1.fields.DeferredType object at 0x7f01a5e703b0>, id: <pydantic.v1.fields.DeferredType object at 0x7f01a5e70470> = None, order_by: <pydantic.v1.fields.DeferredType object at 0x7f01a5e70530> = None, batch_metadata: <pydantic.v1.fields.DeferredType object at 0x7f01a5e70680> = None, batch_definitions: <pydantic.v1.fields.DeferredType object at 0x7f01a5e70830> = None, connect_options: <pydantic.v1.fields.DeferredType object at 0x7f01a5e708f0> = None, data_directory: pathlib.Path, &amp;42;&amp;42;extra_data: typing.Any)

Base class for PathDataAssets which batch by combining the contents of a directory.

Methods

Signature

add_batch_definition_daily(name: str, column: str) → BatchDefinition

Add a BatchDefinition, which creates a single Batch for each day in the directory.

Parameters
  • name – Name of the Batch Definition.

  • column – Column to partition on.

Returns

A BatchDefinition that is partitioned daily.

Signature

add_batch_definition_monthly(name: str, column: str) → BatchDefinition

Add a BatchDefinition which creates a single batch for each month in the directory.

Parameters
  • name – Name of the Batch Definition.

  • column – Column to partition on.

Returns

A BatchDefinition that is partitioned monthly.

Signature

add_batch_definition_whole_directory(name: str) → BatchDefinition

Add a BatchDefinition which creates a single batch for the entire directory.

Signature

add_batch_definition_yearly(name: str, column: str) → BatchDefinition

Add a BatchDefinition which creates a single batch for each year in the directory.

Parameters
  • name – Name of the Batch Definition.

  • column – Column to partition on.

Returns

A BatchDefinition that is partitioned yearly.

Signature

delete_batch_definition(name: str)None

Delete a batch definition.

Parameters

name (str) – Name of the BatchDefinition to delete.

Signature

get_batch_definition(name: str) → great_expectations.core.batch_definition.BatchDefinition

Get a batch definition.

Parameters

name (str) – Name of the BatchDefinition to get.

Raises

KeyError – If the BatchDefinition does not exist.