@staticmethod
def _freshness_params_check(metric, error_msg):
    """
        Check the definition of a freshness metric for consistency, this will
        rise an assertion error if any error is met.

        :param metric: Freshness metric in a dict form.
        :type metric: dict
        :param error_msg: Error message to return in case of error.
        :type error_msg: str
        """
    assert metric['metric'] == 'freshness', error_msg
    assert len(metric) == 3 and 'columns' in metric and ('dateFormat' in
        metric or 'timeFormat' in metric), error_msg
    if 'dateFormat' in metric:
        assert type(metric['dateFormat']) is str
    else:
        assert type(metric['timeFormat']) is str
    columns = metric['columns']
    assert len(columns) > 0, 'Columns list is empty'
    assert type(columns) is list, error_msg
    for col in columns:
        assert type(col) is int or type(col) is str, error_msg
