src/dirbs/listgen/generator.py
def _populate_old_exceptions_list(self, operator_id, executor):
        """Function to populate the old exceptions list for a given operator id."""
        with create_db_connection(self._config.db_config) as conn, conn.cursor() as cursor, CodeProfiler() as cp:
            tblname = self._exceptions_lists_old_part_tblname(operator_id)
            cursor.execute(sql.SQL("""INSERT INTO {0}(operator_id, imei_norm, virt_imei_shard, imsi, msisdn)
                                           SELECT %s, imei_norm, virt_imei_shard, imsi, msisdn
                                             FROM gen_exceptions_list(%s)
                                   """).format(sql.Identifier(tblname)),
                           [operator_id, operator_id])
            num_records = cursor.rowcount
            self._add_pk(conn, tblname=tblname, pk_columns=['imei_norm', 'imsi', 'msisdn'])

        return num_records, cp.duration
Function to populate the old exceptions list for a given operator id.
Function to populate the old exceptions list for a given operator id.
Function to populate the old exceptions list for a given operator id .
def _populate_old_exceptions_list(self, operator_id, executor):
        with create_db_connection(self._config.db_config) as conn, conn.cursor() as cursor, CodeProfiler() as cp:
            tblname = self._exceptions_lists_old_part_tblname(operator_id)
            cursor.execute(sql.SQL("""INSERT INTO {0}(operator_id, imei_norm, virt_imei_shard, imsi, msisdn)
                                           SELECT %s, imei_norm, virt_imei_shard, imsi, msisdn
                                             FROM gen_exceptions_list(%s)
                                   """).format(sql.Identifier(tblname)),
                           [operator_id, operator_id])
            num_records = cursor.rowcount
            self._add_pk(conn, tblname=tblname, pk_columns=['imei_norm', 'imsi', 'msisdn'])
        return num_records, cp.duration
def _populate_old_exceptions_list ( self , operator_id , executor ) : with create_db_connection ( self . _config . db_config ) as conn , conn . cursor ( ) as cursor , CodeProfiler ( ) as cp : tblname = self . _exceptions_lists_old_part_tblname ( operator_id ) cursor . execute ( sql . SQL ( """INSERT INTO {0}(operator_id, imei_norm, virt_imei_shard, imsi, msisdn)
                                           SELECT %s, imei_norm, virt_imei_shard, imsi, msisdn
                                             FROM gen_exceptions_list(%s)
                                   """ ) . format ( sql . Identifier ( tblname ) ) , [ operator_id , operator_id ] ) num_records = cursor . rowcount self . _add_pk ( conn , tblname = tblname , pk_columns = [ 'imei_norm' , 'imsi' , 'msisdn' ] ) return num_records , cp . duration
Function to populate the old exceptions list for a given operator id.
Function to populate the old exceptions list for a given operator id .
"""Function to populate the old exceptions list for a given operator id."""
self
operator_id
executor