@classmethod
def expectation(cls, method_arg_names):
    "Manages configuration and running of expectation objects.\n\n        Expectation builds and saves a new expectation configuration to the DataAsset object. It is the core decorator         used by great expectations to manage expectation configurations.\n\n        Args:\n            method_arg_names (List) : An ordered list of the arguments used by the method implementing the expectation                 (typically the result of inspection). Positional arguments are explicitly mapped to                 keyword arguments when the expectation is run.\n\n        Notes:\n            Intermediate decorators that call the core @expectation decorator will most likely need to pass their             decorated methods' signature up to the expectation decorator. For example, the MetaPandasDataset             column_map_expectation decorator relies on the DataAsset expectation decorator, but will pass through the             signature from the implementing method.\n\n            @expectation intercepts and takes action based on the following parameters:\n                * include_config (boolean or None) :                     If True, then include the generated expectation config as part of the result object.                     For more detail, see :ref:`include_config`.\n                * catch_exceptions (boolean or None) :                     If True, then catch exceptions and include them as part of the result object.                     For more detail, see :ref:`catch_exceptions`.\n                * result_format (str or None) :                     Which output mode to use: `BOOLEAN_ONLY`, `BASIC`, `COMPLETE`, or `SUMMARY`.\n                    For more detail, see :ref:`result_format <result_format>`.\n                * meta (dict or None):                     A JSON-serializable dictionary (nesting allowed) that will be included in the output without                     modification. For more detail, see :ref:`meta`.\n        "

    def outer_wrapper(func):

        @wraps(func)
        def wrapper(self, *args, **kwargs):
            method_name = func.__name__
            all_args = dict(zip(method_arg_names, args))
            all_args.update(kwargs)
            if ('include_config' in kwargs):
                include_config = kwargs['include_config']
                del all_args['include_config']
            else:
                include_config = self.default_expectation_args['include_config']
            if ('catch_exceptions' in kwargs):
                catch_exceptions = kwargs['catch_exceptions']
                del all_args['catch_exceptions']
            else:
                catch_exceptions = self.default_expectation_args['catch_exceptions']
            if ('result_format' in kwargs):
                result_format = kwargs['result_format']
            else:
                result_format = self.default_expectation_args['result_format']
            if ('meta' in kwargs):
                meta = kwargs['meta']
                del all_args['meta']
            else:
                meta = None
            argspec = inspect.getfullargspec(func)[0][1:]
            if ('result_format' in argspec):
                all_args['result_format'] = result_format
            elif ('result_format' in all_args):
                del all_args['result_format']
            all_args = recursively_convert_to_json_serializable(all_args)
            expectation_args = copy.deepcopy(all_args)
            if self._expectation_suite.evaluation_parameters:
                (evaluation_args, substituted_parameters) = build_evaluation_parameters(expectation_args, self._expectation_suite.evaluation_parameters, self._config.get('interactive_evaluation', True), self._data_context)
            else:
                (evaluation_args, substituted_parameters) = build_evaluation_parameters(expectation_args, None, self._config.get('interactive_evaluation', True), self._data_context)
            expectation_config = ExpectationConfiguration(expectation_type=method_name, kwargs=expectation_args, meta=meta)
            raised_exception = False
            exception_traceback = None
            exception_message = None
            if (self._config.get('interactive_evaluation', True) or self._active_validation):
                try:
                    return_obj = func(self, **evaluation_args)
                    if isinstance(return_obj, dict):
                        return_obj = ExpectationValidationResult(**return_obj)
                except Exception as err:
                    if catch_exceptions:
                        raised_exception = True
                        exception_traceback = traceback.format_exc()
                        exception_message = '{}: {}'.format(type(err).__name__, str(err))
                        return_obj = ExpectationValidationResult(success=False)
                    else:
                        raise err
            else:
                return_obj = ExpectationValidationResult(expectation_config=copy.deepcopy(expectation_config))
            if (self._active_validation is True):
                stored_config = expectation_config
            else:
                stored_config = self._expectation_suite.add_expectation(expectation_config)
            if include_config:
                return_obj.expectation_config = copy.deepcopy(stored_config)
            if (return_obj.success is not None):
                stored_config.success_on_last_run = return_obj.success
            if catch_exceptions:
                return_obj.exception_info = {'raised_exception': raised_exception, 'exception_message': exception_message, 'exception_traceback': exception_traceback}
            if (len(substituted_parameters) > 0):
                if (meta is None):
                    meta = dict()
                meta['substituted_parameters'] = substituted_parameters
            if (meta is not None):
                return_obj.meta = meta
            return_obj = recursively_convert_to_json_serializable(return_obj)
            if (self._data_context is not None):
                return_obj = self._data_context.update_return_obj(self, return_obj)
            return return_obj
        return wrapper
    return outer_wrapper
Manages configuration and running of expectation objects.

Expectation builds and saves a new expectation configuration to the DataAsset object. It is the core decorator         used by great expectations to manage expectation configurations.

Args:
    method_arg_names (List) : An ordered list of the arguments used by the method implementing the expectation                 (typically the result of inspection). Positional arguments are explicitly mapped to                 keyword arguments when the expectation is run.

Notes:
    Intermediate decorators that call the core @expectation decorator will most likely need to pass their             decorated methods' signature up to the expectation decorator. For example, the MetaPandasDataset             column_map_expectation decorator relies on the DataAsset expectation decorator, but will pass through the             signature from the implementing method.

    @expectation intercepts and takes action based on the following parameters:
        * include_config (boolean or None) :                     If True, then include the generated expectation config as part of the result object.                     For more detail, see :ref:`include_config`.
        * catch_exceptions (boolean or None) :                     If True, then catch exceptions and include them as part of the result object.                     For more detail, see :ref:`catch_exceptions`.
        * result_format (str or None) :                     Which output mode to use: `BOOLEAN_ONLY`, `BASIC`, `COMPLETE`, or `SUMMARY`.
            For more detail, see :ref:`result_format <result_format>`.
        * meta (dict or None):                     A JSON-serializable dictionary (nesting allowed) that will be included in the output without                     modification. For more detail, see :ref:`meta`.
@classmethod
def expectation(cls, method_arg_names):
    "Manages configuration and running of expectation objects.\n\n        Expectation builds and saves a new expectation configuration to the DataAsset object. It is the core decorator         used by great expectations to manage expectation configurations.\n\n        Args:\n            method_arg_names (List) : An ordered list of the arguments used by the method implementing the expectation                 (typically the result of inspection). Positional arguments are explicitly mapped to                 keyword arguments when the expectation is run.\n\n        Notes:\n            Intermediate decorators that call the core @expectation decorator will most likely need to pass their             decorated methods' signature up to the expectation decorator. For example, the MetaPandasDataset             column_map_expectation decorator relies on the DataAsset expectation decorator, but will pass through the             signature from the implementing method.\n\n            @expectation intercepts and takes action based on the following parameters:\n                * include_config (boolean or None) :                     If True, then include the generated expectation config as part of the result object.                     For more detail, see :ref:`include_config`.\n                * catch_exceptions (boolean or None) :                     If True, then catch exceptions and include them as part of the result object.                     For more detail, see :ref:`catch_exceptions`.\n                * result_format (str or None) :                     Which output mode to use: `BOOLEAN_ONLY`, `BASIC`, `COMPLETE`, or `SUMMARY`.\n                    For more detail, see :ref:`result_format <result_format>`.\n                * meta (dict or None):                     A JSON-serializable dictionary (nesting allowed) that will be included in the output without                     modification. For more detail, see :ref:`meta`.\n        "

    def outer_wrapper(func):

        @wraps(func)
        def wrapper(self, *args, **kwargs):
            method_name = func.__name__
            all_args = dict(zip(method_arg_names, args))
            all_args.update(kwargs)
            if ('include_config' in kwargs):
                include_config = kwargs['include_config']
                del all_args['include_config']
            else:
                include_config = self.default_expectation_args['include_config']
            if ('catch_exceptions' in kwargs):
                catch_exceptions = kwargs['catch_exceptions']
                del all_args['catch_exceptions']
            else:
                catch_exceptions = self.default_expectation_args['catch_exceptions']
            if ('result_format' in kwargs):
                result_format = kwargs['result_format']
            else:
                result_format = self.default_expectation_args['result_format']
            if ('meta' in kwargs):
                meta = kwargs['meta']
                del all_args['meta']
            else:
                meta = None
            argspec = inspect.getfullargspec(func)[0][1:]
            if ('result_format' in argspec):
                all_args['result_format'] = result_format
            elif ('result_format' in all_args):
                del all_args['result_format']
            all_args = recursively_convert_to_json_serializable(all_args)
            expectation_args = copy.deepcopy(all_args)
            if self._expectation_suite.evaluation_parameters:
                (evaluation_args, substituted_parameters) = build_evaluation_parameters(expectation_args, self._expectation_suite.evaluation_parameters, self._config.get('interactive_evaluation', True), self._data_context)
            else:
                (evaluation_args, substituted_parameters) = build_evaluation_parameters(expectation_args, None, self._config.get('interactive_evaluation', True), self._data_context)
            expectation_config = ExpectationConfiguration(expectation_type=method_name, kwargs=expectation_args, meta=meta)
            raised_exception = False
            exception_traceback = None
            exception_message = None
            if (self._config.get('interactive_evaluation', True) or self._active_validation):
                try:
                    return_obj = func(self, **evaluation_args)
                    if isinstance(return_obj, dict):
                        return_obj = ExpectationValidationResult(**return_obj)
                except Exception as err:
                    if catch_exceptions:
                        raised_exception = True
                        exception_traceback = traceback.format_exc()
                        exception_message = '{}: {}'.format(type(err).__name__, str(err))
                        return_obj = ExpectationValidationResult(success=False)
                    else:
                        raise err
            else:
                return_obj = ExpectationValidationResult(expectation_config=copy.deepcopy(expectation_config))
            if (self._active_validation is True):
                stored_config = expectation_config
            else:
                stored_config = self._expectation_suite.add_expectation(expectation_config)
            if include_config:
                return_obj.expectation_config = copy.deepcopy(stored_config)
            if (return_obj.success is not None):
                stored_config.success_on_last_run = return_obj.success
            if catch_exceptions:
                return_obj.exception_info = {'raised_exception': raised_exception, 'exception_message': exception_message, 'exception_traceback': exception_traceback}
            if (len(substituted_parameters) > 0):
                if (meta is None):
                    meta = dict()
                meta['substituted_parameters'] = substituted_parameters
            if (meta is not None):
                return_obj.meta = meta
            return_obj = recursively_convert_to_json_serializable(return_obj)
            if (self._data_context is not None):
                return_obj = self._data_context.update_return_obj(self, return_obj)
            return return_obj
        return wrapper
    return outer_wrapper