[
https://issues.apache.org/jira/browse/TINKERPOP-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18023883#comment-18023883
]
ASF GitHub Bot commented on TINKERPOP-2234:
-------------------------------------------
Cole-Greer commented on code in PR #3211:
URL: https://github.com/apache/tinkerpop/pull/3211#discussion_r2392494188
##########
gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/translator/GremlinTranslatorTest.java:
##########
@@ -741,24 +741,51 @@ public static Collection<Object[]> data() {
null,
null,
"g.inject(long(1694017707000)).as_date()"},
- {"g.inject(\"123.4\").asNumber(N.int)",
- null,
- "g.inject(string0).asNumber(N.int)",
- "g.Inject<object>(\"123.4\").AsNumber(N.Int)",
- "g.Inject(\"123.4\").AsNumber(gremlingo.N.Int)",
- "g.inject(\"123.4\").asNumber(N.int_)",
- "g.inject(\"123.4\").asNumber(N.int_)",
- "g.inject(\"123.4\").asNumber(N.int_)",
- "g.inject('123.4').as_number(N.int)"},
- {"g.inject(\"123.4\").asNumber(N.bigInt)",
- null,
- "g.inject(string0).asNumber(N.bigInt)",
- "g.Inject<object>(\"123.4\").AsNumber(N.BigInt)",
- "g.Inject(\"123.4\").AsNumber(gremlingo.N.BigInt)",
- "g.inject(\"123.4\").asNumber(N.bigInt)",
- "g.inject(\"123.4\").asNumber(N.bigInt)",
- "g.inject(\"123.4\").asNumber(N.bigInt)",
- "g.inject('123.4').as_number(N.big_int)"},
+ {"g.inject(\"123.4\").asNumber(GType.INT)",
+ null,
+ "g.inject(string0).asNumber(GType.INT)",
+ "g.Inject<object>(\"123.4\").AsNumber(GType.Int)",
+
"g.Inject(\"123.4\").AsNumber(gremlingo.GType.Int)",
+ "g.inject(\"123.4\").asNumber(GType.INT)",
+ "g.inject(\"123.4\").asNumber(GType.INT)",
+ "g.inject(\"123.4\").asNumber(GType.int)",
+ "g.inject('123.4').as_number(GType.INT)"},
+ {"g.inject(\"123.4\").asNumber(GType.BIGINT)",
Review Comment:
Is there a reason the Java and Groovy cases are excluded from most of these
scenarios? I'm curious to see these working as there is no replacement for the
old `N` translations in these translators. Also I think it would be good to
have a few which use some of the lowercase GType tokens in addition to all of
these using the all caps forms.
> Introduce Type Predicate
> ------------------------
>
> Key: TINKERPOP-2234
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2234
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.4.2
> Reporter: Stephen Mallette
> Priority: Major
>
> Provide for a {{typeOf()}} predicate that allows for testing the type of an
> object which would enable neat things like:
> {code}
> g.V().outE().has('weight',gt(0.1)).inV().path().unfold().is(typeOf(VERTEX))
> {code}
> See the linked DISCUSS thread for more information.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)