expect_column_values_to_not_match_like_pattern_list
dbt-expectations
·
Column
·
Values format
How it Works
The expect_column_values_to_not_match_like_pattern_list test from the dbt-expectations package is the complement of expect_column_values_to_match_like_pattern_list. It validates that column values do not match any pattern from a list of disallowed SQL LIKE patterns. The match_on argument controls whether values must avoid any (default) or all patterns.
Steps and Conditions
Column Selection: Identify the column to validate.
Define Exclusion List: Provide the LIKE patterns that values must NOT match.
Match Mode: Set
match_ontoanyorall.Execution: Each value is tested against all patterns.
Outcome: Pass if no values match the disallowed patterns; fail if any do.
Example Usage: Content Moderation
A content moderation team wants to block usernames that start with well-known bot or spam prefixes.
Any username matching a known spam prefix triggers a failure, enabling automated review of suspicious registrations before they go live.

