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

Handle escaping the dangling right ] and right } in the regexp transpiler #9239

Merged
merged 3 commits into from
Sep 18, 2023

Conversation

NVnavkumar
Copy link
Collaborator

Fixes #9224.

This enables the transpiler to automatically escape ] and } when they have no left component. This ensures that they will run in optimized form when regex is not required, and will be escaped properly for cuDF.

… transpiler to ensure compatibility with cudf

Signed-off-by: Navin Kumar <[email protected]>
@NVnavkumar NVnavkumar self-assigned this Sep 13, 2023
@NVnavkumar
Copy link
Collaborator Author

build

@sameerz sameerz added the performance A performance related task/issue label Sep 18, 2023
jlowe
jlowe previously approved these changes Sep 18, 2023
@jlowe
Copy link
Member

jlowe commented Sep 18, 2023

Looks like a couple of unit test failures:

[2023-09-13T22:58:51.054Z] - not a quantifier *** FAILED ***
[2023-09-13T22:58:51.054Z]   RegexSequence(ListBuffer(RegexChar('{'), RegexChar('1'), RegexEscaped('}'))) did not equal RegexSequence(ListBuffer(RegexChar('{'), RegexChar('1'), RegexChar('}'))) (RegularExpressionParserSuite.scala:53)
[2023-09-13T22:58:51.054Z]   Analysis:
[2023-09-13T22:58:51.054Z]   RegexSequence(parts: ListBuffer(2: RegexEscaped('}') -> RegexChar('}')), position: Some(value: 0 -> ))
[2023-09-13T22:58:51.055Z] - character classes containing ']' *** FAILED ***
[2023-09-13T22:58:51.055Z]   RegexSequence(ListBuffer(RegexCharacterClass(false, ListBuffer(RegexChar('a'))), RegexEscaped(']'))) did not equal RegexSequence(ListBuffer(RegexCharacterClass(false, ListBuffer(RegexChar('a'))), RegexChar(']'))) (RegularExpressionParserSuite.scala:109)
[2023-09-13T22:58:51.055Z]   Analysis:
[2023-09-13T22:58:51.055Z]   RegexSequence(parts: ListBuffer(1: RegexEscaped(']') -> RegexChar(']')), position: Some(value: 0 -> ))

revans2
revans2 previously approved these changes Sep 18, 2023
Signed-off-by: Navin Kumar <[email protected]>
@NVnavkumar NVnavkumar dismissed stale reviews from revans2 and jlowe via 241b79e September 18, 2023 16:32
@NVnavkumar
Copy link
Collaborator Author

build

@@ -52,7 +52,7 @@ class RegularExpressionParserSuite extends AnyFunSuite {
test("not a quantifier") {
assert(parse("{1}") ===
Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay so because there is nothing in front of the {1} that we do not parse it as a repetition.

@NVnavkumar NVnavkumar merged commit 318807e into NVIDIA:branch-23.10 Sep 18, 2023
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance A performance related task/issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Allow } and }} to be transpiled to static strings
4 participants