Skip to main content
Version: 0.16.16

PandasExecutionEngine

class great_expectations.execution_engine.PandasExecutionEngine(*args, **kwargs)#

PandasExecutionEngine instantiates the ExecutionEngine API to support computations using Pandas.

Constructor builds a PandasExecutionEngine, using provided configuration options.

Parameters
  • *args – Positional arguments for configuring PandasExecutionEngine

  • **kwargs – Keyword arguments for configuring PandasExecutionEngine

For example:

    execution_engine: ExecutionEngine = PandasExecutionEngine(batch_data_dict={batch.id: batch.data})

get_compute_domain(domain_kwargs: dict, domain_type: Union[str, great_expectations.core.metric_domain_types.MetricDomainTypes], accessor_keys: Optional[Iterable[str]] = None) Tuple[pandas.core.frame.DataFrame, dict, dict]#

Uses the given Domain kwargs (which include row_condition, condition_parser, and ignore_row_if directives) to obtain and/or query a batch.

Returns in the format of a Pandas DataFrame along with Domain arguments required for computing. If the Domain is a single column, this is added to 'accessor Domain kwargs' and used for later access.

Parameters
  • domain_kwargs (dict) – a dictionary consisting of the Domain kwargs specifying which data to obtain

  • domain_type (str or MetricDomainTypes) – an Enum value indicating which metric Domain the user would like to be using, or a corresponding string value representing it. String types include "column", "column_pair", "table", and "other". Enum types include capitalized versions of these from the class MetricDomainTypes.

  • accessor_keys (str iterable) – keys that are part of the compute Domain but should be ignored when describing the Domain and simply transferred with their associated values into accessor_domain_kwargs.

Returns

  • a DataFrame (the data on which to compute)

  • a dictionary of compute_domain_kwargs, describing the DataFrame

  • a dictionary of accessor_domain_kwargs, describing any accessors needed to identify the Domain within the compute domain

Return type

A tuple including

get_domain_records(domain_kwargs: dict) pandas.core.frame.DataFrame#

Uses the given Domain kwargs (which include row_condition, condition_parser, and ignore_row_if directives) to obtain and/or query a Batch of data.

Parameters

domain_kwargs (dict) –

Returns

A DataFrame (the data on which to compute returned in the format of a Pandas DataFrame)