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

TINKERPOP-3090 TrimGlobalStep handles unicode characters as Ltrim and Rtrim #2666

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

rdtr
Copy link
Contributor

@rdtr rdtr commented Jun 26, 2024

https://issues.apache.org/jira/browse/TINKERPOP-3090

The current behavior is inconsistent because it relies upon a different API to detect space characters. I think String#trim does not handle unicode characters.

gremlin> g.inject("\u3000abc\u3000").trim().next().length()
==>5
gremlin> g.inject("\u3000abc\u3000").lTrim().next().length()
==>4
gremlin> g.inject("\u3000abc\u3000").rTrim().next().length()
==>4

@rdtr rdtr force-pushed the fix_trim_unicode branch from 2c91a58 to 302843b Compare June 26, 2024 01:22
@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.71%. Comparing base (9b46b67) to head (d391ce8).
Report is 143 commits behind head on 3.7-dev.

Additional details and impacted files
@@              Coverage Diff              @@
##             3.7-dev    #2666      +/-   ##
=============================================
+ Coverage      76.14%   76.71%   +0.57%     
- Complexity     13152    13187      +35     
=============================================
  Files           1084     1087       +3     
  Lines          65160    66368    +1208     
  Branches        7285     7299      +14     
=============================================
+ Hits           49616    50916    +1300     
+ Misses         12839    12740      -99     
- Partials        2705     2712       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rdtr rdtr force-pushed the fix_trim_unicode branch from 302843b to f5fe9ca Compare June 26, 2024 01:49
@@ -39,6 +39,7 @@ This release also includes changes from <<release-3-6-7, 3.6.7>>.
* Deprecated `ltrim()` and `rTrim()` in favor of `l_trim()` and `r_trim` in Python.
* Fixed bug in `onCreate` for `mergeV()` where use of the `Cardinality` functions was not properly handled.
* Fixed multiple concurrent initially requests caused authentication to fail.
* Fixed so that TrimGlobalStep has the same character control handling as Ltrim and Rtrim
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like you need move your changelog entry up to 3.7.3

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved, thanks

@spmallette
Copy link
Contributor

VOTE +1, pending CHANGELOG fix

@spmallette spmallette changed the title TrimGlobalStep handles unicode characters as Ltrim and Rtrim TINKERPOP-3090 TrimGlobalStep handles unicode characters as Ltrim and Rtrim Jun 26, 2024
@xiazcy
Copy link
Contributor

xiazcy commented Jun 26, 2024

VOTE +1, also pending GLV feature test file updates (i.e. gremlin.cs, gremlin.js, gremlin.py, gremlin.go).

@vkagamlyk
Copy link
Contributor

Good to also update TrimLocalStep to unsure consistent behavior.

@rdtr rdtr force-pushed the fix_trim_unicode branch from f5fe9ca to a443ae6 Compare June 26, 2024 17:37
@@ -30,6 +30,7 @@ This release also includes changes from <<release-3-6-8, 3.6.8>>.
* Deprecated public constructor for `SeedStrategy` in favor of builder pattern to be consistent with other strategies.
* Allow specifying a customized Spark app name
* CoinStep has a getter method for its probability field
* Fixed so that TrimGlobalStep has the same character control handling as Ltrim and Rtrim
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: mention TrimLocalStep

@vkagamlyk
Copy link
Contributor

VOTE+1

@rdtr
Copy link
Contributor Author

rdtr commented Jun 28, 2024

same character control

done! Now they all rely on the same common method

@rdtr rdtr force-pushed the fix_trim_unicode branch from a443ae6 to d391ce8 Compare June 28, 2024 00:51
@spmallette spmallette merged commit dc8f203 into apache:3.7-dev Jun 28, 2024
24 checks passed
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.

6 participants