great_expectations.core.evaluation_parameters

Module Contents

Classes

EvaluationParameterParser()

This Evaluation Parameter Parser uses pyparsing to provide a basic expression language capable of evaluating

Functions

build_evaluation_parameters(expectation_args, evaluation_parameters=None, interactive_evaluation=True, data_context=None)

Build a dictionary of parameters to evaluate, using the provided evaluation_parameters,

find_evaluation_parameter_dependencies(parameter_expression)

Parse a parameter expression to identify dependencies including GE URNs.

parse_evaluation_parameter(parameter_expression, evaluation_parameters=None, data_context=None)

Use the provided evaluation_parameters dict to parse a given parameter expression.

_deduplicate_evaluation_parameter_dependencies(dependencies)

great_expectations.core.evaluation_parameters.logger
great_expectations.core.evaluation_parameters._epsilon = 1e-12
class great_expectations.core.evaluation_parameters.EvaluationParameterParser

This Evaluation Parameter Parser uses pyparsing to provide a basic expression language capable of evaluating parameters using values available only at run time.

expop :: ‘^’ multop :: ‘*’ | ‘/’ addop :: ‘+’ | ‘-‘ integer :: [‘+’ | ‘-‘] ‘0’..’9’+ atom :: PI | E | real | fn ‘(‘ expr ‘)’ | ‘(‘ expr ‘)’ factor :: atom [ expop factor ]* term :: factor [ multop factor ]* expr :: term [ addop term ]*

The parser is modified from: https://github.com/pyparsing/pyparsing/blob/master/examples/fourFn.py

opn
fn
push_first(self, toks)
push_unary_minus(self, toks)
clear_stack(self)
get_parser(self)
evaluate_stack(self, s)
great_expectations.core.evaluation_parameters.build_evaluation_parameters(expectation_args, evaluation_parameters=None, interactive_evaluation=True, data_context=None)

Build a dictionary of parameters to evaluate, using the provided evaluation_parameters, AND mutate expectation_args by removing any parameter values passed in as temporary values during exploratory work.

great_expectations.core.evaluation_parameters.expr
great_expectations.core.evaluation_parameters.find_evaluation_parameter_dependencies(parameter_expression)

Parse a parameter expression to identify dependencies including GE URNs.

Parameters

parameter_expression – the parameter to parse

Returns

  • “urns”: set of strings that are valid GE URN objects

  • ”other”: set of non-GE URN strings that are required to evaluate the parameter expression

Return type

a dictionary including

great_expectations.core.evaluation_parameters.parse_evaluation_parameter(parameter_expression, evaluation_parameters=None, data_context=None)

Use the provided evaluation_parameters dict to parse a given parameter expression.

Parameters
  • parameter_expression (str) – A string, potentially containing basic arithmetic operations and functions, and variables to be substituted

  • evaluation_parameters (dict) – A dictionary of name-value pairs consisting of values to substitute

  • data_context (DataContext) – A data context to use to obtain metrics, if necessary

The parser will allow arithmetic operations +, -, /, *, as well as basic functions, including trunc() and round() to obtain integer values when needed for certain expectations (e.g. expect_column_value_length_to_be_between).

Valid variables must begin with an alphabetic character and may contain alphanumeric characters plus ‘_’ and ‘$’, EXCEPT if they begin with the string “urn:great_expectations” in which case they may also include additional characters to support inclusion of GE URLs (see Evaluation Parameters for more information).

great_expectations.core.evaluation_parameters._deduplicate_evaluation_parameter_dependencies(dependencies)
great_expectations.core.evaluation_parameters.EvaluationParameterIdentifier