コード例 #1
0
def run_checks_for_table(db, table):
    print (f"Running checks for table:{table.table_name} [BEGIN]")
    check_data_delayed(db, table)
    print (f"Check data delayed table:{table.table_name} [DONE]")
    check_if_schema_changed(db, table)
    print (f"Check for schema changes table:{table.table_name} [DONE]")
    check_data_valume_diff(db, table)
    print (f"Check for data volume diff table:{table.table_name} [DONE]")
    
    for interval in settings.VOLUME_INTERVAL:
        check_data_volume(db, table, interval)
    
    print (f"Check for data volume table:{table.table_name} [DONE]")

    for column in table.schema['columns']:
        for interval in settings.VOLUME_INTERVAL:
            if db.is_numeric(column['type']):
                check_min(db, table, column['name'], interval)
                check_max(db, table, column['name'], interval)
                check_avg(db, table, column['name'], interval)
                check_count_nulls(db, table, column['name'], interval)
    
        if db.is_character(column['type']):
            check_count_per_value(db, table, column['name'], '1 day')
            check_count_nulls(db, table, column['name'], '1 day')
    
    print (f"Check for data values table:{table.table_name} [DONE]")
    print (f"Running checks for table:{table.table_name} [DONE]")
コード例 #2
0
def run_checks_for_table(db, table):
    check_data_delayed(db, table)
    print(f"Check data delayed table:{table.table_name} [DONE]")
    check_if_schema_changed(db, table)
    print(f"Check for schema changes table:{table.table_name} [DONE]")
    check_data_valume_diff(db, table)
    print(f"Check for data volume diff table:{table.table_name} [DONE]")

    for interval in settings.VOLUME_INTERVAL:
        check_data_volume(db, table, interval)

    print(f"Check for data volume table:{table.table_name} [DONE]")

    for column in table.schema['columns']:
        for interval in settings.VOLUME_INTERVAL:
            if column['type'] in [
                    'bigint', 'integer', 'double precision', 'int'
            ]:
                check_min(db, table, column['name'], interval)
                check_max(db, table, column['name'], interval)
                check_avg(db, table, column['name'], interval)
                check_count_nulls(db, table, column['name'], interval)

        if column['type'] in ['text', 'varchar']:
            check_count_per_value(db, table, column['name'], '1 day')
            check_count_nulls(db, table, column['name'], '1 day')

    print(f"Check for data values table:{table.table_name} [DONE]")