src/dirbs/importer/operator_data_importer.py
def _check_unclean_ratio(self):
        """Check whether the percentage of rows with either an invalid IMEI or IMSI is less than our threshold."""
        with self._conn.cursor() as cursor:
            cursor.execute(sql.SQL("""SELECT COUNT(*)
                                        FROM {0}
                                       WHERE is_unclean_imei(imei_norm, imei)
                                          OR is_unclean_imsi(imsi_norm)""")
                           .format(self._staging_tbl_identifier))
            failing_check = cursor.fetchone()[0]
            ratio = failing_check / self._data_length
            threshold = self._unclean_threshold
            return 'unclean data (combined)', ratio <= threshold, ratio, threshold, 'unclean'
Check whether the percentage of rows with either an invalid IMEI or IMSI is less than our threshold.
Check whether the percentage of rows with either an invalid IMEI or IMSI is less than our threshold.
Check whether the percentage of rows with either an invalid IMEI or IMSI is less than our threshold .
def _check_unclean_ratio(self):
        with self._conn.cursor() as cursor:
            cursor.execute(sql.SQL("""SELECT COUNT(*)
                                        FROM {0}
                                       WHERE is_unclean_imei(imei_norm, imei)
                                          OR is_unclean_imsi(imsi_norm)""")
                           .format(self._staging_tbl_identifier))
            failing_check = cursor.fetchone()[0]
            ratio = failing_check / self._data_length
            threshold = self._unclean_threshold
            return 'unclean data (combined)', ratio <= threshold, ratio, threshold, 'unclean'
def _check_unclean_ratio ( self ) : with self . _conn . cursor ( ) as cursor : cursor . execute ( sql . SQL ( """SELECT COUNT(*)
                                        FROM {0}
                                       WHERE is_unclean_imei(imei_norm, imei)
                                          OR is_unclean_imsi(imsi_norm)""" ) . format ( self . _staging_tbl_identifier ) ) failing_check = cursor . fetchone ( ) [ 0 ] ratio = failing_check / self . _data_length threshold = self . _unclean_threshold return 'unclean data (combined)' , ratio <= threshold , ratio , threshold , 'unclean'
Check whether the percentage of rows with either an invalid IMEI or IMSI is less than our threshold.
Check whether the percentage of rows with either an invalid IMEI or IMSI is less than our threshold .
"""Check whether the percentage of rows with either an invalid IMEI or IMSI is less than our threshold."""
self