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 support for regex flags for BigQuery #253

Closed lookslikeitsnot closed 1 year ago

lookslikeitsnot commented 1 year ago

What does this PR do?

Add support for regex flags for BigQuery (#252)

Change description

Inline flags in non-capturing block

Type of change

Where has this been tested?

clausherther commented 1 year ago

Thanks! Will take a closer look tomorrow or Thursday.

lookslikeitsnot commented 1 year ago

Test failed for Snowflake

Database Error in test dbt_expectations_expect_column_values_to_match_regex_data_text_email_address__i___i_A_Z_ (models/schema_tests/schema.yml)
02:05:13    100048 (2201B): Invalid regular expression: '(?i)[A-Z]', no argument for repetition operator: ?

I should've read the Snowflake docs more carefully, sorry. Snowflake, since it's using POSIX ERE, does not support inline flags. I'll make the test BigQuery only since its purpose is to check the in-lining of flag parameters for the BigQuery adapter.