hexpop.py
def clean_regions(regions):
    """Check regions input against prepared geopop tables."""
    logger = logging.getLogger(f"{__name__}.{sys._getframe().f_code.co_name}")
    initialize_logging(logger)
    client = bq_client()
    dataset_id = '.'.join([client.project, 'geopop'])
    regional_tables = [
        t.table_id for t in client.list_tables(dataset_id)
        if t.table_type == 'TABLE'
    ]
    if 'all' in regions:
        return regional_tables
    for region in regions:
        if region not in regional_tables:
            logger.warning("no table found for region %s in dataset %s",
                           region, dataset_id)
    return regions
Check regions input against prepared geopop tables.
Check regions input against prepared geopop tables.
Check regions input against prepared geopop tables .
def clean_regions(regions):
    logger = logging.getLogger(f"{__name__}.{sys._getframe().f_code.co_name}")
    initialize_logging(logger)
    client = bq_client()
    dataset_id = '.'.join([client.project, 'geopop'])
    regional_tables = [
        t.table_id for t in client.list_tables(dataset_id)
        if t.table_type == 'TABLE'
    ]
    if 'all' in regions:
        return regional_tables
    for region in regions:
        if region not in regional_tables:
            logger.warning("no table found for region %s in dataset %s",
                           region, dataset_id)
    return regions
def clean_regions ( regions ) : logger = logging . getLogger ( f"{__name__}.{sys._getframe().f_code.co_name}" ) initialize_logging ( logger ) client = bq_client ( ) dataset_id = '.' . join ( [ client . project , 'geopop' ] ) regional_tables = [ t . table_id for t in client . list_tables ( dataset_id ) if t . table_type == 'TABLE' ] if 'all' in regions : return regional_tables for region in regions : if region not in regional_tables : logger . warning ( "no table found for region %s in dataset %s" , region , dataset_id ) return regions
Check regions input against prepared geopop tables.
Check regions input against prepared geopop tables .
"""Check regions input against prepared geopop tables."""
regions