xiazcy commented on code in PR #3244:
URL: https://github.com/apache/tinkerpop/pull/3244#discussion_r2446229906
##########
docs/src/upgrade/release-3.8.x.asciidoc:
##########
@@ -623,6 +623,43 @@ gremlin> g.V().choose(__.values("age")).
==>peter
----
+*Removal of choose().option(Traversal, v)*
+
+The `choose().option(Traversal, v)` was relatively unused in comparison to the
other overloads with constants, predicates
+and Pick tokens. The previous implementation often led to confusion as it only
evaluated if the traversal was productive,
+rather than performing comparisons based on the traversal's output value. To
eliminate this confusion, `Traversal` is no
+longer permitted as an option token for `choose()`. Any usages which are
dependent on the Traversal for dynamic case
+matching can be rewritten using `union()`, with filters prepended to each
child traversal.
+
+[source,text]
+----
+// 3.7.x
+gremlin> g.V().hasLabel("person").choose(identity()).
+......1> option(outE().count().is(P.gt(2)), values("age")).
+......2> option(none, values("name"))
+==>29
+==>vadas
+==>josh
+==>peter
Review Comment:
Technically this isn't the confusing one, given `is(P())` is a filter it
will only produce based on the desired filtering. The example is meant to show
what people can do as an alternative, i.e. this particular one can be replaced
with a union() with where().
An actual meaningless query would be something like:
```
gremlin> g.V().hasLabel("person").choose(identity()).
option(outE().count(), values("age")).
option(none, values("name"))
==>29
==>27
==>32
==>35
```
But I don't think it needs to be shown here per se.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]