src/dirbs/listgen/generator.py
def _populate_mcc_mnc_table(self, conn):
        """Function to populate the MCC-MNC -> operator ID lookup table for this run."""
        with conn.cursor() as cursor, CodeProfiler() as cp:
            tblname = self._mnc_mcc_new_tblname
            execute_values(cursor,
                           sql.SQL("""INSERT INTO {0}(mcc_mnc_pattern, operator_id)
                                           VALUES %s""").format(sql.Identifier(tblname)).as_string(cursor),
                           [(p['mcc'] + p['mnc'] + '%', op.id) for op in self._operators for p in op.mcc_mnc_pairs])
            self._add_pk(conn, tblname=tblname, pk_columns=['mcc_mnc_pattern'])
            self._analyze_helper(cursor, tblname)

        # Need to get table count since execute_values doesn't retain insert count
        num_records = self._get_total_record_count(conn, tblname)
        return num_records, cp.duration
Function to populate the MCC-MNC -> operator ID lookup table for this run.
Function to populate the MCC-MNC -> operator ID lookup table for this run.
Function to populate the MCC - MNC - > operator ID lookup table for this run .
def _populate_mcc_mnc_table(self, conn):
        with conn.cursor() as cursor, CodeProfiler() as cp:
            tblname = self._mnc_mcc_new_tblname
            execute_values(cursor,
                           sql.SQL("""INSERT INTO {0}(mcc_mnc_pattern, operator_id)
                                           VALUES %s""").format(sql.Identifier(tblname)).as_string(cursor),
                           [(p['mcc'] + p['mnc'] + '%', op.id) for op in self._operators for p in op.mcc_mnc_pairs])
            self._add_pk(conn, tblname=tblname, pk_columns=['mcc_mnc_pattern'])
            self._analyze_helper(cursor, tblname)
        num_records = self._get_total_record_count(conn, tblname)
        return num_records, cp.duration
def _populate_mcc_mnc_table ( self , conn ) : with conn . cursor ( ) as cursor , CodeProfiler ( ) as cp : tblname = self . _mnc_mcc_new_tblname execute_values ( cursor , sql . SQL ( """INSERT INTO {0}(mcc_mnc_pattern, operator_id)
                                           VALUES %s""" ) . format ( sql . Identifier ( tblname ) ) . as_string ( cursor ) , [ ( p [ 'mcc' ] + p [ 'mnc' ] + '%' , op . id ) for op in self . _operators for p in op . mcc_mnc_pairs ] ) self . _add_pk ( conn , tblname = tblname , pk_columns = [ 'mcc_mnc_pattern' ] ) self . _analyze_helper ( cursor , tblname ) num_records = self . _get_total_record_count ( conn , tblname ) return num_records , cp . duration
Function to populate the MCC-MNC -> operator ID lookup table for this run.
Function to populate the MCC - MNC - > operator ID lookup table for this run .
"""Function to populate the MCC-MNC -> operator ID lookup table for this run.""" # Need to get table count since execute_values doesn't retain insert count
self
conn