Skip to content

Commit 0fc776d

Browse files
committed
Merge branch '3.8-dev'
2 parents 79528ea + 53008f1 commit 0fc776d

5 files changed

Lines changed: 12 additions & 8 deletions

File tree

CHANGELOG.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ This release also includes changes from <<release-3-7-XXX, 3.7.XXX>>.
113113
* Updated `OptionsStrategy` in `gremlin-python` to take options directly as keyword arguments.
114114
* Added static `instance()` method to `ElementIdStrategy` to an instance with the default configuration.
115115
* Updated `ElementIdStrategy.getConfiguration()` to help with serialization.
116+
* Changed type for `ReservedKeysVerificationStrategy.keys` in .NET to take a `Set<string>` rather than `List<string>`.
116117
117118
== TinkerPop 3.7.0 (Gremfir Master of the Pan Flute)
118119

gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/DotNetTranslateVisitor.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,16 +280,18 @@ public Void visitConfiguration(final GremlinParser.ConfigurationContext ctx) {
280280
sb.append(": ");
281281
visit(ctx.getChild(2));
282282

283-
// need to convert List to Set for readPartitions until TINKERPOP-3032
283+
// need to convert List as needed to deal with fussy things in strategy construction inconsistencies
284+
// TINKERPOP-3032/TINKERPOP-3055 - so messy
284285
if (ctx.getChild(0).getText().equals("readPartitions")) {
285286
// find the last "List" in sb and replace it with "HashSet"
286287
final int ix = sb.lastIndexOf("List<object>");
287288
sb.replace(ix, ix + 12, "HashSet<string>");
288289
} else if (ctx.getChild(0).getText().equals("keys")) {
289-
// find the last "List" in sb and replace it with "HashSet"
290-
final int ix = sb.lastIndexOf("List<object>");
290+
// find the last "HashSet<object>" in sb and replace it with "HashSet<object>" so that it aligns to
291+
// the type needed for keys -
292+
final int ix = sb.lastIndexOf("HashSet<object>");
291293
if (ix > -1)
292-
sb.replace(ix, ix + 12, "List<string>");
294+
sb.replace(ix, ix + 15, "HashSet<string>");
293295
}
294296

295297
return null;

gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/translator/GremlinTranslatorTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,10 +583,10 @@ public static Collection<Object[]> data() {
583583
null,
584584
null,
585585
"g.with_bulk(x)"},
586-
{"g.withStrategies(ReservedKeysVerificationStrategy(keys:{'x','y'}))", /// if you happen to do [] you get a List in translation...........
586+
{"g.withStrategies(ReservedKeysVerificationStrategy(keys:{'x','y'}))", /// if you happen to do [] you get a List in translation...........TINKERPOP-3055
587587
"g.withStrategies(ReservedKeysVerificationStrategy(keys:{'x', 'y'}))",
588588
"g.withStrategies(ReservedKeysVerificationStrategy(keys:set0))",
589-
"g.WithStrategies(new ReservedKeysVerificationStrategy(keys: new HashSet<object> { \"x\", \"y\" }))",
589+
"g.WithStrategies(new ReservedKeysVerificationStrategy(keys: new HashSet<string> { \"x\", \"y\" }))",
590590
"g.WithStrategies(gremlingo.ReservedKeysVerificationStrategy(gremlingo.ReservedKeysVerificationStrategyConfig{Keys: gremlingo.NewSimpleSet(\"x\", \"y\")}))",
591591
"g.withStrategies(new ReservedKeysVerificationStrategy(keys:['x', 'y'] as Set))",
592592
"g.withStrategies(ReservedKeysVerificationStrategy.build().keys(new HashSet<Object>() {{ add(\"x\"); add(\"y\"); }}).create())",

gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Verification/ReservedKeysVerificationStrategy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public ReservedKeysVerificationStrategy() : base(JavaFqcn)
4747
/// <param name="throwException">Throw an exception if a reserved key is used.</param>
4848
/// <param name="keys">List of keys to define as reserved. If not set then the defaults are used.</param>
4949
public ReservedKeysVerificationStrategy(bool logWarning = false, bool throwException = false,
50-
List<string>? keys = null)
50+
ISet<string>? keys = null)
5151
: this()
5252
{
5353
Configuration["logWarning"] = logWarning;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def choose_graph(step, graph_name):
8585
if not step.context.ignore:
8686
step.context.ignore = "AllowNullPropertyValues" in tagset
8787

88+
# TINKERPOP-3055
8889
if not step.context.ignore:
8990
step.context.ignore = "WithReservedKeysVerificationStrategy" in tagset
9091

@@ -190,7 +191,7 @@ def raise_an_error(step):
190191
def raise_an_error_with_message(step, comparison, expected_message):
191192
if (step.context.ignore):
192193
return
193-
194+
194195
assert_that(step.context.failed, equal_to(True))
195196

196197
if comparison == "containing":

0 commit comments

Comments
 (0)