src/dirbs/listgen/generator.py
def _populate_old_blacklist(self, executor):
        """Function to populate the old blacklist."""
        with create_db_connection(self._config.db_config) as conn, conn.cursor() as cursor, CodeProfiler() as cp:
            tblname = self._blacklist_old_tblname
            cursor.execute(sql.SQL("""INSERT INTO {0}(imei_norm, virt_imei_shard, block_date, reasons)
                                           SELECT imei_norm, virt_imei_shard, block_date, reasons
                                             FROM gen_blacklist()
                                   """).format(sql.Identifier(tblname)))
            num_records = cursor.rowcount
            self._add_pk(conn, tblname=tblname, pk_columns=['imei_norm'])
            self._analyze_helper(cursor, tblname)

        return num_records, cp.duration
Function to populate the old blacklist.
Function to populate the old blacklist.
Function to populate the old blacklist .
def _populate_old_blacklist(self, executor):
        with create_db_connection(self._config.db_config) as conn, conn.cursor() as cursor, CodeProfiler() as cp:
            tblname = self._blacklist_old_tblname
            cursor.execute(sql.SQL("""INSERT INTO {0}(imei_norm, virt_imei_shard, block_date, reasons)
                                           SELECT imei_norm, virt_imei_shard, block_date, reasons
                                             FROM gen_blacklist()
                                   """).format(sql.Identifier(tblname)))
            num_records = cursor.rowcount
            self._add_pk(conn, tblname=tblname, pk_columns=['imei_norm'])
            self._analyze_helper(cursor, tblname)
        return num_records, cp.duration
def _populate_old_blacklist ( self , executor ) : with create_db_connection ( self . _config . db_config ) as conn , conn . cursor ( ) as cursor , CodeProfiler ( ) as cp : tblname = self . _blacklist_old_tblname cursor . execute ( sql . SQL ( """INSERT INTO {0}(imei_norm, virt_imei_shard, block_date, reasons)
                                           SELECT imei_norm, virt_imei_shard, block_date, reasons
                                             FROM gen_blacklist()
                                   """ ) . format ( sql . Identifier ( tblname ) ) ) num_records = cursor . rowcount self . _add_pk ( conn , tblname = tblname , pk_columns = [ 'imei_norm' ] ) self . _analyze_helper ( cursor , tblname ) return num_records , cp . duration
Function to populate the old blacklist.
Function to populate the old blacklist .
"""Function to populate the old blacklist."""
self
executor