# Path: hecatoncheir/exception.py
# class ValidationError(Exception):
#     source = None
# 
#     def __init__(self, value, rule, params=None, source=None):
#         self.value = value
#         self.rule = rule
#         self.params = params
#         self.source = source
# 
#     def __str__(self):
#         return self.value
# 
# Path: hecatoncheir/msgutil.py
# class DbProfilerJSONEncoder(json.JSONEncoder):
#     def default(self, o):
# def jsonize(data):


import StatisticsValidator
from hecatoncheir.exception import ValidationError
from hecatoncheir.msgutil import gettext as _
            'min': 101,
            'max': 1000,
            'cardinality': 10}]}
    assert v.validate(s) == True
    """
    def __init__(self, label, rule):
        StatisticsValidator.StatisticsValidator.__init__(self, label, rule)

    def validate(self, stats):
        """Validate a min/max rule based the column statistics

        Args:
            stats (dict): a table statistics. see Data_Structure.txt
                          for more info.

        Returns:
            True if the expression is true, otherwise False.
        """
        # rule: [ column_name, expression ]
        assert len(self.rule) == 2
        assert 'columns' in stats

        c = None
        for col in stats['columns']:
            if col['column_name'] == self.rule[0]:
                c = col
                break

        if c is None:
            raise ValidationError(

# Path: hecatoncheir/exception.py
# class ValidationError(Exception):
#     source = None
# 
#     def __init__(self, value, rule, params=None, source=None):
#         self.value = value
#         self.rule = rule
#         self.params = params
#         self.source = source
# 
#     def __str__(self):
#         return self.value
# 
# Path: hecatoncheir/msgutil.py
# class DbProfilerJSONEncoder(json.JSONEncoder):
#     def default(self, o):
# def jsonize(data):


# Path: hecatoncheir/validator/StatEvalValidator.py
import StatisticsValidator
from hecatoncheir.exception import ValidationError
from hecatoncheir.msgutil import gettext as _

            'min': 101,
            'max': 1000,
            'cardinality': 10}]}
    assert v.validate(s) == True
    """
    def __init__(self, label, rule):
        StatisticsValidator.StatisticsValidator.__init__(self, label, rule)

    def validate(self, stats):
        """Validate a min/max rule based the column statistics

        Args:
            stats (dict): a table statistics. see Data_Structure.txt
                          for more info.

        Returns:
            True if the expression is true, otherwise False.
        """
        # rule: [ column_name, expression ]
        assert len(self.rule) == 2
        assert 'columns' in stats

        c = None
        for col in stats['columns']:
            if col['column_name'] == self.rule[0]:
                c = col
                break

        if c is None:
            raise ValidationError(

                _("Column `%s' not found. Check your validation rule again.") %