src/dirbs/importer/operator_data_importer.py
def _check_data_date_range(self):
        """Checks whether the data in the staging table matches what is specified in the filename."""
        expected_start_date, expected_end_date = importer_utils.operator_expected_file_dates(self._filename)
        metric_key = 'data_daterange'
        curr_date = datetime.date.today()
        if expected_end_date > curr_date:
            return False, \
                'End date on operator data dump file is in the future (later than current system date)', \
                metric_key

        with self._conn.cursor() as cursor:
            cursor.execute(sql.SQL('SELECT COUNT(*) FROM {0} WHERE connection_date < %s OR connection_date > %s')
                           .format(self._staging_tbl_identifier),
                           [expected_start_date, expected_end_date])
            invalid_count = cursor.fetchone()[0]
            if invalid_count > 0:
                return False, '{0:d} records are outside the date range supplied by the filename {1}' \
                    .format(invalid_count, self._filename), metric_key

            return True, 'Data date range check passed', metric_key
Checks whether the data in the staging table matches what is specified in the filename.
Checks whether the data in the staging table matches what is specified in the filename.
Checks whether the data in the staging table matches what is specified in the filename .
def _check_data_date_range(self):
        expected_start_date, expected_end_date = importer_utils.operator_expected_file_dates(self._filename)
        metric_key = 'data_daterange'
        curr_date = datetime.date.today()
        if expected_end_date > curr_date:
            return False, \
                'End date on operator data dump file is in the future (later than current system date)', \
                metric_key
        with self._conn.cursor() as cursor:
            cursor.execute(sql.SQL('SELECT COUNT(*) FROM {0} WHERE connection_date < %s OR connection_date > %s')
                           .format(self._staging_tbl_identifier),
                           [expected_start_date, expected_end_date])
            invalid_count = cursor.fetchone()[0]
            if invalid_count > 0:
                return False, '{0:d} records are outside the date range supplied by the filename {1}' \
                    .format(invalid_count, self._filename), metric_key
            return True, 'Data date range check passed', metric_key
def _check_data_date_range ( self ) : expected_start_date , expected_end_date = importer_utils . operator_expected_file_dates ( self . _filename ) metric_key = 'data_daterange' curr_date = datetime . date . today ( ) if expected_end_date > curr_date : return False , 'End date on operator data dump file is in the future (later than current system date)' , metric_key with self . _conn . cursor ( ) as cursor : cursor . execute ( sql . SQL ( 'SELECT COUNT(*) FROM {0} WHERE connection_date < %s OR connection_date > %s' ) . format ( self . _staging_tbl_identifier ) , [ expected_start_date , expected_end_date ] ) invalid_count = cursor . fetchone ( ) [ 0 ] if invalid_count > 0 : return False , '{0:d} records are outside the date range supplied by the filename {1}' . format ( invalid_count , self . _filename ) , metric_key return True , 'Data date range check passed' , metric_key
Checks whether the data in the staging table matches what is specified in the filename.
Checks whether the data in the staging table matches what is specified in the filename .
"""Checks whether the data in the staging table matches what is specified in the filename."""
self