[
https://issues.apache.org/jira/browse/TINKERPOP-2491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18031905#comment-18031905
]
ASF GitHub Bot commented on TINKERPOP-2491:
-------------------------------------------
Cole-Greer commented on PR #3250:
URL: https://github.com/apache/tinkerpop/pull/3250#issuecomment-3429658930
Can you add an unfold to one more case here:
https://github.com/apache/tinkerpop/blob/a64ed7220e2978a4ccc8bae1d21ded642f934077/docs/src/recipes/shortest-path.asciidoc?plain=1#L190
Other than that, VOTE +1
> Improve consistency of the output of range() oriented steps
> -----------------------------------------------------------
>
> Key: TINKERPOP-2491
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2491
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.4.9
> Reporter: Stephen Mallette
> Assignee: Andrea Child
> Priority: Major
> Labels: breaking
> Fix For: 4.0.0, 3.8.0
>
>
> As pointed out here:
> https://groups.google.com/g/gremlin-users/c/OvxKvvM8rXs/m/slnv6cWpBQAJ
> there is an automatic {{List}} unfold with {{limit(local, 1)}} as in:
> {code}
> g.inject([1, 2, 3], [4]).limit(local, 3).toList() // [[1, 2, 3], [4]]
> g.inject([1, 2, 3], [4]).limit(local, 2).toList() // [[1, 2], [4]]
> g.inject([1, 2, 3], [4]).limit(local, 1).toList() // [1, 4] ??? - Expected
> [[1], [4]]
> g.inject([1, 2, 3], [4]).limit(local, 0).toList() // [[], []] oh come on
> {code}
> In addition, `range()` and `tail()` are similarly affected:
> {code}
> gremlin> g.inject([1, 2, 3], [4]).tail(local, 1).toList()
> ==>3
> ==>4
> gremlin> g.inject([1, 2, 3], [4]).range(local, 0, 1).toList()
> ==>1
> ==>4
> {code}
> Changing this is a fairly imposing breaking change in behavior. We could
> mitigate that with a strategy to support the old functionality if folks want
> to have that:
> {code}
> g.withStrategy(OldWayStrategy).inject([1, 2, 3], [4]).limit(local, 1)
> {code}
> would transform to:
> {code}
> g.inject([1, 2, 3], [4]).limit(local, 1).unfold()
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)