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 bug regex parentheses #744

Merged
merged 8 commits into from
Jan 22, 2025
Merged

Fix bug regex parentheses #744

merged 8 commits into from
Jan 22, 2025

Conversation

fabian-moessner
Copy link
Collaborator

No description provided.

@fabian-moessner fabian-moessner marked this pull request as ready for review January 21, 2025 13:51

assert lucene_filter == RegExFilterExpression(["regex_key_one"], ".*value.*")

def test_creates_lucene_compliance_filter_parentheses_or(self):
Copy link
Collaborator

@ppcad ppcad Jan 22, 2025

Choose a reason for hiding this comment

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

Additionally, tests for 'regex_key: (/.*value_one.*/ OR /.*value_two.*/)' and 'mixed_key: (/.*value_one.*/ OR "/.*value_two.*/")' would be good.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added 'regex_key: (/.*value_one.*/ OR /.*value_two.*/)'.
Altered 'regex_key_one:(/.*value.*./ OR key_two: "/.*value.*/")' to 'regex_key_one: (/.*value_one.*/ OR /.*value_two.*/)'.

Are more nested parentheses structures necessary?

Copy link
Collaborator Author

@fabian-moessner fabian-moessner Jan 22, 2025

Choose a reason for hiding this comment

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

... no conflict raised here:

lucene_filter = LuceneFilter.create('regex_key_one: (/.*value_one.*/ OR "/.*value_two.*/")') assert lucene_filter == Or( RegExFilterExpression(["regex_key_one"], ".*value_one.*"), StringFilterExpression(["regex_key_one"], "/.*value_two.*/"), )

Copy link
Collaborator

@ppcad ppcad Jan 22, 2025

Choose a reason for hiding this comment

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

Added 'regex_key: (/.*value_one.*/ OR /.*value_two.*/)'. Altered 'regex_key_one:(/.*value.*./ OR key_two: "/.*value.*/")' to 'regex_key_one: (/.*value_one.*/ OR /.*value_two.*/)'.

Are more nested parentheses structures necessary?

Thank you! In my opinion those tests are enough, but I'm not against having more tests.

Copy link
Collaborator

Choose a reason for hiding this comment

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

... no conflict raised here:

lucene_filter = LuceneFilter.create('regex_key_one: (/.*value_one.*/ OR "/.*value_two.*/")') assert lucene_filter == Or( RegExFilterExpression(["regex_key_one"], ".*value_one.*"), StringFilterExpression(["regex_key_one"], "/.*value_two.*/"), )

Sorry, it was a mistake. I have edited it out a while ago.

MoessnerFabian(Group) added 2 commits January 22, 2025 12:09
@fabian-moessner fabian-moessner requested a review from ppcad January 22, 2025 11:30
Copy link
Collaborator

@ppcad ppcad left a comment

Choose a reason for hiding this comment

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

Thank you for the fix!

@ppcad ppcad linked an issue Jan 22, 2025 that may be closed by this pull request
Copy link
Collaborator

@ekneg54 ekneg54 left a comment

Choose a reason for hiding this comment

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

please add an entry in the CHANGELOG.md file for this bugfix

@ekneg54 ekneg54 merged commit cc2e6b8 into main Jan 22, 2025
13 checks passed
@ekneg54 ekneg54 deleted the fix-bug-regex-parentheses branch January 22, 2025 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regex parsing error with parentheses and new lucene syntax
3 participants