src/dirbs/importer/abstract_importer.py
def _validate_historical_checks(self):
        """Method to validate staging data prior to import. By default does nothing."""
        self._logger.info('Running historic validation checks on staging table data...')
        for check, result, value, hvalue, min_required_value, metric_key in self._historical_validation_checks:
            if not result:
                msg = 'Failed {check} historic check, historic value is: {hvalue:.2f}, ' \
                      'imported data has: {value:.2f} and minimum required is {min_required_value:.2f}'
                raise exceptions.ValidationCheckException(msg.format(check=check,
                                                                     hvalue=hvalue,
                                                                     value=value,
                                                                     min_required_value=min_required_value),
                                                          metric_key=metric_key,
                                                          statsd=self._statsd,
                                                          metrics_failures_root=self._metrics_failures_root)
            else:
                msg = 'Passed {check} historic check, historic value is: {hvalue:.2f}, ' \
                      'imported data has: {value:.2f} and minimum required is {min_required_value:.2f}'
                self._logger.info(msg.format(check=check,
                                             hvalue=hvalue,
                                             value=value,
                                             min_required_value=min_required_value))
        self._logger.info('Finished running historic validation checks on staging table data')
Method to validate staging data prior to import. By default does nothing.
Method to validate staging data prior to import. By default does nothing.
Method to validate staging data prior to import . By default does nothing .
def _validate_historical_checks(self):
        self._logger.info('Running historic validation checks on staging table data...')
        for check, result, value, hvalue, min_required_value, metric_key in self._historical_validation_checks:
            if not result:
                msg = 'Failed {check} historic check, historic value is: {hvalue:.2f}, ' \
                      'imported data has: {value:.2f} and minimum required is {min_required_value:.2f}'
                raise exceptions.ValidationCheckException(msg.format(check=check,
                                                                     hvalue=hvalue,
                                                                     value=value,
                                                                     min_required_value=min_required_value),
                                                          metric_key=metric_key,
                                                          statsd=self._statsd,
                                                          metrics_failures_root=self._metrics_failures_root)
            else:
                msg = 'Passed {check} historic check, historic value is: {hvalue:.2f}, ' \
                      'imported data has: {value:.2f} and minimum required is {min_required_value:.2f}'
                self._logger.info(msg.format(check=check,
                                             hvalue=hvalue,
                                             value=value,
                                             min_required_value=min_required_value))
        self._logger.info('Finished running historic validation checks on staging table data')
def _validate_historical_checks ( self ) : self . _logger . info ( 'Running historic validation checks on staging table data...' ) for check , result , value , hvalue , min_required_value , metric_key in self . _historical_validation_checks : if not result : msg = 'Failed {check} historic check, historic value is: {hvalue:.2f}, ' 'imported data has: {value:.2f} and minimum required is {min_required_value:.2f}' raise exceptions . ValidationCheckException ( msg . format ( check = check , hvalue = hvalue , value = value , min_required_value = min_required_value ) , metric_key = metric_key , statsd = self . _statsd , metrics_failures_root = self . _metrics_failures_root ) else : msg = 'Passed {check} historic check, historic value is: {hvalue:.2f}, ' 'imported data has: {value:.2f} and minimum required is {min_required_value:.2f}' self . _logger . info ( msg . format ( check = check , hvalue = hvalue , value = value , min_required_value = min_required_value ) ) self . _logger . info ( 'Finished running historic validation checks on staging table data' )
Method to validate staging data prior to import.
Method to validate staging data prior to import .
"""Method to validate staging data prior to import. By default does nothing."""
self