Skip to content

Commit 2e206de

Browse files
committed
TINKERPOP-2699 Enabled a test
Seems we can handle this test now with improved Map handling in the grammar. CTR
1 parent 8891298 commit 2e206de

File tree

4 files changed

+19
-17
lines changed
  • gremlin-go/driver/cucumber
  • gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber
  • gremlin-python/src/main/python/radish
  • gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect

4 files changed

+19
-17
lines changed

gremlin-go/driver/cucumber/gremlin.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,6 +1979,7 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[
19791979
"g_V_hasLabelXsongX_group_byXnameX_byXproperties_groupCount_byXlabelXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("song").Group().By("name").By(gremlingo.T__.Properties().GroupCount().By(gremlingo.T.Label))}},
19801980
"g_V_outXfollowedByX_group_byXsongTypeX_byXbothE_group_byXlabelX_byXweight_sumXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Out("followedBy").Group().By("songType").By(gremlingo.T__.BothE().Group().By(gremlingo.T.Label).By(gremlingo.T__.Values("weight").Sum()))}},
19811981
"g_V_group_byXlabelX_byXbothE_groupXaX_byXlabelX_byXweight_sumX_weight_sumX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Group().By(gremlingo.T.Label).By(gremlingo.T__.BothE().Group("a").By(gremlingo.T.Label).By(gremlingo.T__.Values("weight").Sum()).Values("weight").Sum())}},
1982+
"g_withSideEffectXa__marko_666_noone_blahX_V_groupXaX_byXnameX_byXoutE_label_foldX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", map[interface{}]interface{}{"marko": []interface{}{"666"}, "noone": []interface{}{"blah"} }).V().Group("a").By("name").By(gremlingo.T__.OutE().Label().Fold()).Cap("a").Unfold().Group().By(gremlingo.Column.Keys).By(gremlingo.T__.Select(gremlingo.Column.Values).Order(gremlingo.Scope.Local).By(gremlingo.Order.Asc))}},
19821983
"g_V_hasLabelXpersonX_asXpX_outXcreatedX_group_byXnameX_byXselectXpX_valuesXageX_sumX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("person").As("p").Out("created").Group().By("name").By(gremlingo.T__.Select("p").Values("age").Sum())}},
19831984
"g_V_group_byXlabelX_byXlabel_countX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Group().By(gremlingo.T__.Label()).By(gremlingo.T__.Label().Count())}},
19841985
"g_V_hasXperson_name_withinXvadas_peterXX_group_by_byXout_order_foldX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("person", "name", gremlingo.P.Within("vadas", "peter")).Group().By().By(gremlingo.T__.Out().Order().Fold())}},

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

Lines changed: 1 addition & 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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,6 +1982,7 @@
19821982
'g_V_hasLabelXsongX_group_byXnameX_byXproperties_groupCount_byXlabelXX': [(lambda g:g.V().has_label('song').group().by('name').by(__.properties().group_count().by(T.label)))],
19831983
'g_V_outXfollowedByX_group_byXsongTypeX_byXbothE_group_byXlabelX_byXweight_sumXX': [(lambda g:g.V().out('followedBy').group().by('songType').by(__.both_e().group().by(T.label).by(__.values('weight').sum_())))],
19841984
'g_V_group_byXlabelX_byXbothE_groupXaX_byXlabelX_byXweight_sumX_weight_sumX': [(lambda g:g.V().group().by(T.label).by(__.both_e().group('a').by(T.label).by(__.values('weight').sum_()).values('weight').sum_()))],
1985+
'g_withSideEffectXa__marko_666_noone_blahX_V_groupXaX_byXnameX_byXoutE_label_foldX_capXaX': [(lambda g:g.with_side_effect('a', { 'marko': ['666'], 'noone': ['blah'] }).V().group('a').by('name').by(__.out_e().label().fold()).cap('a').unfold().group().by(Column.keys).by(__.select(Column.values).order(Scope.local).by(Order.asc)))],
19851986
'g_V_hasLabelXpersonX_asXpX_outXcreatedX_group_byXnameX_byXselectXpX_valuesXageX_sumX': [(lambda g:g.V().has_label('person').as_('p').out('created').group().by('name').by(__.select('p').values('age').sum_()))],
19861987
'g_V_group_byXlabelX_byXlabel_countX': [(lambda g:g.V().group().by(__.label()).by(__.label().count()))],
19871988
'g_V_hasXperson_name_withinXvadas_peterXX_group_by_byXout_order_foldX': [(lambda g:g.V().has('person', 'name', P.within('vadas', 'peter')).group().by().by(__.out().order().fold()))],

gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/Group.feature

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -183,23 +183,22 @@ Feature: Step - group()
183183
| result |
184184
| m[{"software":"d[2.0].d", "person":"d[5.0].d"}] |
185185

186-
# This test works, but the test frameworks don't all support it well because of how parameters are now processed
187-
# in 3.6.0 where we need more than just simple JSON processing. would be nice to "ignore" it somehow as it does
188-
# work in some situations but not all test frameworks have that ability either (i.e. to ignore prior to parsing
189-
# the parameter). TINKERPOP-2699
190-
#
191-
# The post-ordering really isn't really right but works around TINKERPOP-2600
192-
# Scenario: g_withSideEffectXa__marko_666_noone_blahX_V_groupXaX_byXnameX_byXoutE_label_foldX_capXaX
193-
# Given the modern graph
194-
# And using the parameter xx1 defined as "m[{\"marko\":\"l[\"666\"]\", \"noone\":\"l[\"blah\"]\"}]"
195-
# And the traversal of
196-
# """
197-
# g.withSideEffect("a", xx1).V().group("a").by("name").by(__.outE().label().fold()).cap("a").unfold().group().by(Column.keys).by(select(Column.values).order(Scope.local).by(Order.asc))
198-
# """
199-
# When iterated to list
200-
# Then the result should be unordered
201-
# | result |
202-
# | m[{"ripple":[], "peter":["created"], "noone":["blah"], "vadas":[], "josh":["created", "created"], "lop":[], "marko":["666", "created", "knows", "knows"]}] |
186+
Scenario: g_withSideEffectXa__marko_666_noone_blahX_V_groupXaX_byXnameX_byXoutE_label_foldX_capXaX
187+
Given the modern graph
188+
And the traversal of
189+
"""
190+
g.withSideEffect("a", [marko:["666"],noone:["blah"]]).V().
191+
group("a").
192+
by("name").
193+
by(__.outE().label().fold()).
194+
cap("a").unfold().
195+
group().by(Column.keys).by(select(Column.values).
196+
order(Scope.local).by(Order.asc))
197+
"""
198+
When iterated to list
199+
Then the result should be unordered
200+
| result |
201+
| m[{"ripple":[], "peter":["created"], "noone":["blah"], "vadas":[], "josh":["created", "created"], "lop":[], "marko":["666", "created", "knows", "knows"]}] |
203202

204203
@GraphComputerVerificationStarGraphExceeded
205204
Scenario: g_V_hasLabelXpersonX_asXpX_outXcreatedX_group_byXnameX_byXselectXpX_valuesXageX_sumX

0 commit comments

Comments
 (0)