[
https://issues.apache.org/jira/browse/TINKERPOP-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16473522#comment-16473522
]
ASF GitHub Bot commented on TINKERPOP-1963:
-------------------------------------------
GitHub user spmallette opened a pull request:
https://github.com/apache/tinkerpop/pull/865
TINKERPOP-1963 Fixed branch() problems with reducing steps as options
https://issues.apache.org/jira/browse/TINKERPOP-1963
Not sure I fixed this in the best way possible, but I added an
`IdentityStep` to the front of each option:
https://github.com/apache/tinkerpop/compare/tp32...TINKERPOP-1963?expand=1#diff-546a91c51e7b731ccea30f0e4aff5d83R68
and then later checked that step to see if anything had been injected into
it to determine if the choice had evaluated to `true` or not (since that was
the existing way in which that was done). I'm open to better approaches to
resolving this problem if they can be suggested. Also ready to hear that "this
way won't work because..." In the mean time.....
All tests pass with `docker/build.sh -t -n -i`
VOTE +1
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/tinkerpop TINKERPOP-1963
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tinkerpop/pull/865.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #865
----
commit 96072c7bc8962bbd15c6263c5e5eed6af8f9dd27
Author: Stephen Mallette <spmva@...>
Date: 2018-05-09T21:52:32Z
TINKERPOP-1963 Fixed branch() problems with reducing steps as options
----
> Use of reducing step in choose()
> --------------------------------
>
> Key: TINKERPOP-1963
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1963
> Project: TinkerPop
> Issue Type: Bug
> Components: process
> Affects Versions: 3.2.9
> Reporter: stephen mallette
> Assignee: stephen mallette
> Priority: Major
> Fix For: 3.4.0, 3.3.4, 3.2.10
>
>
> {code}
> gremlin> g.inject(1).choose(is(1), constant(true), constant(false))
> ==>true
> gremlin> g.inject(1).choose(is(1), fold(), constant(false))
> ==>[1]
> {code}
> But if I put some reducing step in the branch that's not supposed to be
> emitted:
> {code}
> gremlin> g.inject(1).choose(is(1), constant(true), fold())
> ==>[]
> ==>true
> gremlin> g.inject(1).choose(is(1), constant(true), max())
> ==>NaN
> ==>true
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)