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

Add optional flags argument to regex tests #247

Closed tconbeer closed 1 year ago

tconbeer commented 1 year ago

Closes #245

I chose to validate the flag against the lists in the documentation for Postgres, Snowflake, and Redshift. I decided to raise an error if flags are passed to BQ (since they are not supported) or the "default" implementation (unclear support).

One alternative to raising on all flags for those adapters would be to specifically check for the i flag and lowercase the column before passing it to regexp_instr.

clausherther commented 1 year ago

Cool, thanks @tconbeer, will take a look this weekend. Btw, the compatibility check for BQ causes CI to fail, so we'll have to come with another way to handle this before this can be merged:

The flag option is not supported for by BigQuery
tconbeer commented 1 year ago

Thanks, @clausherther ! Love this package