great_expectations.core.evaluation_parameters
¶
Module Contents¶
Classes¶
This Evaluation Parameter Parser uses pyparsing to provide a basic expression language capable of evaluating |
Functions¶
|
Build a dictionary of parameters to evaluate, using the provided evaluation_parameters, |
|
Parse a parameter expression to identify dependencies including GE URNs. |
|
Use the provided evaluation_parameters dict to parse a given parameter expression. |
|
-
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: dict, evaluation_parameters: Optional[dict] = None, interactive_evaluation: bool = True, data_context=None) → Tuple[dict, dict]¶ 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: str, evaluation_parameters: Optional[Dict[str, Any]] = None, data_context: Optional[Any] = None) → Any¶ 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: dict) → dict¶
-
great_expectations.core.evaluation_parameters.
EvaluationParameterIdentifier
¶