(conn)
return [(table_name, secondary_indexes) for table_name, secondary_indexes in secondary_indexes_per_table.items()]
Return metrics about each `table`.
Return metrics about each `table`.
Return metrics about each table .
def get_table_config_metrics(conn):
    # type: (rethinkdb.net.Connection) -> List[tuple]
    """
    Return metrics about each `table`.
    """
    secondary_indexes_per_table = (
        TABLE_CONFIG.pluck('name', 'indexes')
        # [table1, table2, ...] -> [index1_1, index1_2, ..., index2_1, index2_2, ...]
        .concat_map(lambda row: row['indexes'].map(lambda _: {'table': row['name']}))
        # [...] -> {table1: [index1_1, index1_2, ...], table2: [index2_1, index2_2, ...]}
        .group('table')
        # {...} -> {table1: num_indexes_1, table2: num_indexes_2, ...}
        .count().run(conn)
    )  # type: Dict[str, int]

    return [(table_name, secondary_indexes) for table_name, secondary_indexes in secondary_indexes_per_table.items()]
def get_table_config_metrics ( conn ) : # type: (rethinkdb.net.Connection) -> List[tuple] secondary_indexes_per_table = ( TABLE_CONFIG . pluck ( 'name' , 'indexes' ) # [table1, table2, ...] -> [index1_1, index1_2, ..., index2_1, index2_2, ...] . concat_map ( lambda row : row [ 'indexes' ] . map ( lambda _ : { 'table' : row [ 'name' ] } ) ) # [...] -> {table1: [index1_1, index1_2, ...], table2: [index2_1, index2_2, ...]} . group ( 'table' ) # {...} -> {table1: num_indexes_1, table2: num_indexes_2, ...} . count ( ) . run ( conn ) ) # type: Dict[str, int] return [ ( table_name , secondary_indexes ) for table_name , secondary_indexes in secondary_indexes_per_table . items ( ) ]