Skip to content

Commit fa4a72a

Browse files
committed
Merge branch '3.8-dev'
2 parents 9cc25e0 + 38ed5e7 commit fa4a72a

8 files changed

Lines changed: 41 additions & 1 deletion

File tree

CHANGELOG.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ This release also includes changes from <<release-3-7-XXX, 3.7.XXX>>.
114114
* Updated `OptionsStrategy` in `gremlin-python` to take options directly as keyword arguments.
115115
* Added static `instance()` method to `ElementIdStrategy` to an instance with the default configuration.
116116
* Updated `ElementIdStrategy.getConfiguration()` to help with serialization.
117+
* Fixed issue in `gremlin-go` where `Next()` didn't return the error from the server.
117118
* Changed type for `ReservedKeysVerificationStrategy.keys` in .NET to take a `Set<string>` rather than `List<string>`.
118119
* Fixed bug in `group()` value traversal of the second `by()` where a `CollectingBarrierStep` could produce an unexpected filtering effect when `ReducingBarrierStep` or `SupplyingBarrierStep` instances were not taken into account.
119120
* Changed `DetachedFactory` to special case the handling of `ComputerAdjacentVertex` which doesn't carry properties but still needs to be detachable for OLAP cases.

gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,8 @@ private static IDictionary<string, List<Func<GraphTraversalSource, IDictionary<s
360360
{"g_V_hasLabelXpersonX_order_byXageX_valuesXnameX_skipX1X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().HasLabel("person").Order().By("age").Values<object>("name").Skip<object>(1)}},
361361
{"g_VX1X_valuesXageX_rangeXlocal_20_30X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V(p["vid1"]).Values<object>("age").Range<object>(Scope.Local, 20, 30)}},
362362
{"g_V_mapXin_hasIdX1XX_limitX2X_valuesXnameX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().Map<object>(__.In().HasId(p["vid1"])).Limit<object>(2).Values<object>("name")}},
363+
{"g_V_rangeX2_1X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().Range<object>(2, 1)}},
364+
{"g_V_rangeX3_2X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().Range<object>(3, 2)}},
363365
{"g_E_sampleX1X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.E().Sample(1)}},
364366
{"g_E_sampleX2X_byXweightX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.E().Sample(2).By("weight")}},
365367
{"g_V_localXoutE_sampleX1X_byXweightXX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().Local<object>(__.OutE().Sample(1).By("weight"))}},

gremlin-go/driver/cucumber/gremlin.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[
333333
"g_V_hasLabelXpersonX_order_byXageX_valuesXnameX_skipX1X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("person").Order().By("age").Values("name").Skip(1)}},
334334
"g_VX1X_valuesXageX_rangeXlocal_20_30X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Values("age").Range(gremlingo.Scope.Local, 20, 30)}},
335335
"g_V_mapXin_hasIdX1XX_limitX2X_valuesXnameX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Map(gremlingo.T__.In().HasId(p["vid1"])).Limit(2).Values("name")}},
336+
"g_V_rangeX2_1X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Range(2, 1)}},
337+
"g_V_rangeX3_2X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Range(3, 2)}},
336338
"g_E_sampleX1X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E().Sample(1)}},
337339
"g_E_sampleX2X_byXweightX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E().Sample(2).By("weight")}},
338340
"g_V_localXoutE_sampleX1X_byXweightXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Local(gremlingo.T__.OutE().Sample(1).By("weight"))}},

gremlin-go/driver/traversal.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ func (t *Traversal) Next() (*Result, error) {
112112
return nil, err
113113
}
114114
if results.IsEmpty() {
115+
err = results.GetError()
116+
if err != nil {
117+
return nil, err
118+
}
115119
return nil, newError(err0903NextNoResultsLeftError)
116120
}
117121
result, _, err := results.One()
@@ -718,7 +722,7 @@ func ParseBigDecimal(strValue string) *BigDecimal {
718722
}
719723
// resolve big int
720724
unscaled := new(big.Int)
721-
unscaled, ok = unscaled.SetString(strings.Replace(bfVal.String(), ".", "",-1), 10)
725+
unscaled, ok = unscaled.SetString(strings.Replace(bfVal.String(), ".", "", -1), 10)
722726
if !ok {
723727
return nil
724728
}

gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gremlin-python/src/main/python/radish/gremlin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@
352352
'g_V_hasLabelXpersonX_order_byXageX_valuesXnameX_skipX1X': [(lambda g:g.V().has_label('person').order().by('age').values('name').skip(1))],
353353
'g_VX1X_valuesXageX_rangeXlocal_20_30X': [(lambda g, vid1=None:g.V(vid1).values('age').range_(Scope.local, 20, 30))],
354354
'g_V_mapXin_hasIdX1XX_limitX2X_valuesXnameX': [(lambda g, vid1=None:g.V().map(__.in_().has_id(vid1)).limit(2).values('name'))],
355+
'g_V_rangeX2_1X': [(lambda g:g.V().range_(2, 1))],
356+
'g_V_rangeX3_2X': [(lambda g:g.V().range_(3, 2))],
355357
'g_E_sampleX1X': [(lambda g:g.E().sample(1))],
356358
'g_E_sampleX2X_byXweightX': [(lambda g:g.E().sample(2).by('weight'))],
357359
'g_V_localXoutE_sampleX1X_byXweightXX': [(lambda g:g.V().local(__.out_e().sample(1).by('weight')))],

gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/features/StepDefinition.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,10 @@ public void theTraversalOf(final String docString) {
352352

353353
@When("iterated to list")
354354
public void iteratedToList() {
355+
if ((null == traversal) && (error != null)) {
356+
return; // Error probably occurred during traversal construction. Skip to prevent NPE.
357+
}
358+
355359
try {
356360
result = traversal.toList();
357361
} catch (Exception ex) {
@@ -361,6 +365,10 @@ public void iteratedToList() {
361365

362366
@When("iterated next")
363367
public void iteratedNext() {
368+
if ((null == traversal) && (error != null)) {
369+
return; // Error probably occurred during traversal construction. Skip to prevent NPE.
370+
}
371+
364372
try {
365373
result = traversal.next();
366374
} catch (Exception ex) {

gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Range.feature

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,3 +328,22 @@ Feature: Step - range()
328328
| result |
329329
| marko |
330330
| marko |
331+
332+
Scenario: g_V_rangeX2_1X
333+
Given the modern graph
334+
And the traversal of
335+
"""
336+
g.V().range(2, 1)
337+
"""
338+
When iterated to list
339+
Then the traversal will raise an error with message containing text of "Not a legal range: [2, 1]"
340+
341+
# iterated next variant of the previous test (which is iterated to list)
342+
Scenario: g_V_rangeX3_2X
343+
Given the modern graph
344+
And the traversal of
345+
"""
346+
g.V().range(3, 2)
347+
"""
348+
When iterated next
349+
Then the traversal will raise an error with message containing text of "Not a legal range: [3, 2]"

0 commit comments

Comments
 (0)