A SQL statement that is evaluated to return rows that match an
invalid state. If any rows are are returned, this rule fails.
The SQL statement must use GoogleSQL
syntax <https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax>__,
and must not contain any semicolons.
You can use the data reference parameter ${data()} to reference
the source table with all of its precondition filters applied.
Examples of precondition filters include row filters, incremental
data filters, and sampling. For more information, see Data
reference
parameter <https://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter>__.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class SqlAssertion (2.11.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.11.0 (latest)](/python/docs/reference/dataplex/latest/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [2.10.2](/python/docs/reference/dataplex/2.10.2/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [2.9.0](/python/docs/reference/dataplex/2.9.0/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [2.8.0](/python/docs/reference/dataplex/2.8.0/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [2.7.1](/python/docs/reference/dataplex/2.7.1/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [2.6.0](/python/docs/reference/dataplex/2.6.0/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [2.5.0](/python/docs/reference/dataplex/2.5.0/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [2.4.0](/python/docs/reference/dataplex/2.4.0/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [2.3.1](/python/docs/reference/dataplex/2.3.1/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [2.2.2](/python/docs/reference/dataplex/2.2.2/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [2.1.0](/python/docs/reference/dataplex/2.1.0/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [2.0.1](/python/docs/reference/dataplex/2.0.1/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [1.13.0](/python/docs/reference/dataplex/1.13.0/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [1.12.3](/python/docs/reference/dataplex/1.12.3/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [1.11.0](/python/docs/reference/dataplex/1.11.0/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [1.10.0](/python/docs/reference/dataplex/1.10.0/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [1.9.0](/python/docs/reference/dataplex/1.9.0/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [1.8.1](/python/docs/reference/dataplex/1.8.1/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [1.7.0](/python/docs/reference/dataplex/1.7.0/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [1.6.2](/python/docs/reference/dataplex/1.6.2/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [1.5.1](/python/docs/reference/dataplex/1.5.1/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [1.4.3](/python/docs/reference/dataplex/1.4.3/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [1.3.0](/python/docs/reference/dataplex/1.3.0/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [1.2.0](/python/docs/reference/dataplex/1.2.0/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [1.1.3](/python/docs/reference/dataplex/1.1.3/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [1.0.1](/python/docs/reference/dataplex/1.0.1/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [0.2.1](/python/docs/reference/dataplex/0.2.1/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion)\n- [0.1.0](/python/docs/reference/dataplex/0.1.0/google.cloud.dataplex_v1.types.DataQualityRule.SqlAssertion) \n\n SqlAssertion(mapping=None, *, ignore_unknown_fields=False, **kwargs)\n\nA SQL statement that is evaluated to return rows that match an\ninvalid state. If any rows are are returned, this rule fails.\n\nThe SQL statement must use `GoogleSQL\nsyntax \u003chttps://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax\u003e`__,\nand must not contain any semicolons.\n\nYou can use the data reference parameter `${data()}` to reference\nthe source table with all of its precondition filters applied.\nExamples of precondition filters include row filters, incremental\ndata filters, and sampling. For more information, see `Data\nreference\nparameter \u003chttps://cloud.google.com/dataplex/docs/auto-data-quality-overview#data-reference-parameter\u003e`__.\n\nExample: `SELECT * FROM ${data()} WHERE price \u003c 0`"]]