check_table operator

When to use the check_table operator

The check_table operator allows you add checks on table level. For example

  • Count the number of row

  • Sum of a column

  • Checks involving multiple columns

This operator is a wrapper around Airflow’s SQLTableCheckOperator to allow seamless integrations with SDK supported dataset like Astro tables.

Supported Checks

Supported checks are also explained here.

    imdb_movies = aql.load_file(
        File("https://raw.githubusercontent.com/astronomer/astro-sdk/main/python-sdk/tests/data/homes.csv"),
        output_table=Table(conn_id="sqlite_default"),
    )
    aql.check_table(
        dataset=imdb_movies,
        checks={
            "sell_list": {"check_statement": "sell <= list"},
            "row_count": {"check_statement": "Count(*) = 47"},
        },
    )