Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server/pypika/filter): Fix "notmatches" operator for backends using REGEXP #1507

Merged
merged 1 commit into from
Oct 4, 2022

Conversation

lukapeschke
Copy link
Contributor

closes TCTC-3808

Signed-off-by: Luka Peschke luka.peschke@toucantoco.com

@lukapeschke lukapeschke added bug Something isn't working need review labels Oct 3, 2022
@lukapeschke lukapeschke self-assigned this Oct 3, 2022
@render
Copy link

render bot commented Oct 3, 2022

…ng REGEXP

closes TCTC-3808

Signed-off-by: Luka Peschke <luka.peschke@toucantoco.com>
@@ -177,7 +177,7 @@ def test_notmatches_regexp_filter(
ctx = regexp_translator.filter(step=step, columns=selected_columns, **default_step_kwargs)
expected_query = (
Query.from_(previous_step)
.where(Field(column).regexp(regex).negate())
.where(Field(column).regexp(f"%{regex}%").negate())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree. Here, I want to test that the function is called with the regex surrounded by % characters. The test form you suggest would not catch an error if the get_compliant_regex function was bogus

@lukapeschke lukapeschke merged commit 8ffacc3 into master Oct 4, 2022
@lukapeschke lukapeschke deleted the fix-pattern-snowflake branch October 4, 2022 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants