ibis-project / ibis-bigquery

BigQuery backend for Ibis
Apache License 2.0
19 stars 18 forks source link

Fix converting regex to raw string #111

Closed jayceslesar closed 2 years ago

jayceslesar commented 2 years ago

@cpcloud @tswast Thoughts?

Fixes issue where regexes passed into re_search among other re functions in the ibis library were being converted to strings prefixed with r'my_original_string' which seems less than useful if 'my_original_string' is a regex.

Before generated BigQuery would look like:

SELECT *
FROM `my_project.my_dataset.my_table`
WHERE REGEXP_CONTAINS(`field`, r'(some_message_\\(\\(&some_signal\\)\\))')

whereas now it looks like:

SELECT *
FROM `my_project.my_dataset.my_table`
WHERE REGEXP_CONTAINS(`field`, '(some_message_\\(\\(&some_signal\\)\\))')

Will close #110