Skip to content

TINKERPOP-3083: The split() step should provide a way to split an entire string#98

Closed
andreachild wants to merge 1 commit intoBit-Quill:4.0-backportfrom
andreachild:4.0-backport-splitStep
Closed

TINKERPOP-3083: The split() step should provide a way to split an entire string#98
andreachild wants to merge 1 commit intoBit-Quill:4.0-backportfrom
andreachild:4.0-backport-splitStep

Conversation

@andreachild
Copy link

@andreachild andreachild commented Mar 7, 2025

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

Changed split() local and global steps to parse a string into individual characters if the separator is an empty string - previous implementation left the string intact. Introduced StringUtil utility class to reuse logic between the global and local step classes. Feature tests were executed using -DskipIntegrationTests=false and manual testing was executed using gremlin console with and without remote context.

Changelog entry to add when we have a designated section for it:

  • Modified the split() step to split a string into a list of its characters if the given separator is an empty string.

Upgrade doc to add when we have a designated section for it:

==== Splitting a string into characters using split()
The `split()` step will now split a string into a list of its characters if the given separator is an empty string.
[source,groovy]
----
// previous implementation
g.inject("Hello").split("")
==>[Hello]
// new implementation
g.inject("Hello").split("")
==>[H,e,l,l,o]
----
See: link:https://issues.apache.org/jira/browse/TINKERPOP-3083[TINKERPOP-3083]

This is a back port from master branch which is at version 4.0. Original PR: apache#2741

… StringUtil.split utility method which will split the given string into a list of individual string characters if the given separator is an empty string.
@codecov
Copy link

codecov bot commented Mar 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (4.0-backport@430cc36). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff               @@
##             4.0-backport      #98   +/-   ##
===============================================
  Coverage                ?   76.37%           
  Complexity              ?    13238           
===============================================
  Files                   ?     1062           
  Lines                   ?    61574           
  Branches                ?     7344           
===============================================
  Hits                    ?    47025           
  Misses                  ?    12029           
  Partials                ?     2520           

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@andreachild andreachild changed the title TINKERPOP-3083 Change SplitGlobalStep and SplitLocalStep to use a new… TINKERPOP-3083: The split() step should provide a way to split an entire string Mar 10, 2025
@andreachild andreachild marked this pull request as ready for review March 10, 2025 21:38
@Cole-Greer
Copy link

Nit: CHANGELOG. Otherwise LGTM

@andreachild
Copy link
Author

Nit: CHANGELOG. Otherwise LGTM
Changelog should be added to the official branch at a later point as there is no section for 3.8 yet.

@andreachild
Copy link
Author

Closing and will reopen new PR against 3.8-dev

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.

2 participants