Class SqlAssertion (2.0.0)

SqlAssertion(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Queries for rows returned by the provided SQL statement. If any rows are are returned, this rule fails.

The SQL statement needs to use BigQuery standard SQL syntax, and must not contain any semicolons.

${data()} can be used to reference the rows being evaluated, i.e. the table after all additional filters (row filters, incremental data filters, sampling) are applied.

Example: SELECT * FROM ${data()} WHERE price < 0

Attribute

Name Description
sql_statement str
Optional. The SQL statement.