Skip to main content
Version: 1.0 prerelease

BatchRequest

class great_expectations.datasource.fluent.BatchRequest(*, datasource_name: pydantic.v1.types.StrictStr, data_asset_name: pydantic.v1.types.StrictStr, options: Dict[pydantic.v1.types.StrictStr, Any] = None, partitioner: Optional[Union[great_expectations.core.partitioners.PartitionerColumnValue, great_expectations.core.partitioners.PartitionerMultiColumnValue, great_expectations.core.partitioners.PartitionerDividedInteger, great_expectations.core.partitioners.PartitionerModInteger, great_expectations.core.partitioners.PartitionerYear, great_expectations.core.partitioners.PartitionerYearAndMonth, great_expectations.core.partitioners.PartitionerYearAndMonthAndDay, great_expectations.core.partitioners.PartitionerDatetimePart, great_expectations.core.partitioners.PartitionerConvertedDatetime]] = None, batching_regex: Optional[re.Pattern] = None)#

A BatchRequest is the way to specify which data Great Expectations will validate.

A Batch Request is provided to a Data Asset in order to create one or more Batches.

Parameters:
  • datasource_name – The name of the Datasource used to connect to the data.

  • data_asset_name – The name of the Data Asset used to connect to the data.

  • options – A dict that can be used to filter the batch groups associated with the Data Asset. The dict structure depends on the asset type. The available keys for dict can be obtained by calling DataAsset.get_batch_parameters_keys(…).

  • batch_slice – A python slice that can be used to filter the sorted batches by index. e.g. batch_slice = “[-5:]” will request only the last 5 batches after the options filter is applied.

Returns:

BatchRequest

dict(*, include: AbstractSetIntStr | MappingIntStrAny | None = None, exclude: AbstractSetIntStr | MappingIntStrAny | None = None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, skip_defaults: bool | None = None) dict[str, Any]#

Generate a dictionary representation of the BatchRequest, optionally specifying which fields to include or exclude.

json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) str#

Generate a json representation of the BatchRequest, optionally specifying which fields to include or exclude.

update_batch_slice(value: Optional[Union[Sequence[Optional[pydantic.v1.types.StrictInt]], great_expectations.datasource.data_connector.batch_filter.SliceValidator, pydantic.v1.types.StrictInt, pydantic.v1.types.StrictStr]] = None) None#

Updates the batch_slice on this BatchRequest.

Parameters:

value – The new value to be parsed into a python slice and set on the batch_slice attribute.

Returns:

None