calogica / dbt-expectations

Port(ish) of Great Expectations to dbt test macros
https://calogica.github.io/dbt-expectations/
Apache License 2.0
1.06k stars 128 forks source link

[Feature Request] Allow regex flags/parameters in regexp_instr and calling tests #245

Closed tconbeer closed 1 year ago

tconbeer commented 1 year ago

Is your feature request related to a problem? Please describe. I would like the regex I provide to expect_column_values_to_match_regex_list and similar tests to be case-insensitive, but currently that is not possible.

Postgres, Snowflake, and Redshift support an argument (called flags in pg and parameters in the others) for this. BigQuery does not, but the column could be lowercased before being passed into regexp_instr.

Describe the solution you'd like Add a flags argument to expect_column_values_to_match_regex_list and other regex-based tests that accepts a string value and passes it through to the underlying database implementation.

Describe alternatives you've considered Rolling my own test.

Additional context I'm happy to contribute this if there is interest.

clausherther commented 1 year ago

@tconbeer Thanks for this feature request! This seems like a useful and worthwhile addition, happy to take any PRs.