You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/11/13 20:17:00 UTC

[jira] [Commented] (TINKERPOP-2314) Employ by(String) for Map when possible and improve errors around incorrect types

    [ https://issues.apache.org/jira/browse/TINKERPOP-2314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16973659#comment-16973659 ] 

ASF GitHub Bot commented on TINKERPOP-2314:
-------------------------------------------

spmallette commented on pull request #1223: TINKERPOP-2314 Employ by(String) for Map when possible
URL: https://github.com/apache/tinkerpop/pull/1223
 
 
   https://issues.apache.org/jira/browse/TINKERPOP-2314
   
   Also improve errors around incorrect types that might be called using this modulator overload. See upgrade docs for reasoning and examples of what's happening here.
   
   All tests pass with `docker/build.sh -t -n -i`
   
   VOTE +1
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Employ by(String) for Map when possible and improve errors around incorrect types
> ---------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-2314
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2314
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.3.9
>            Reporter: Stephen Mallette
>            Assignee: Stephen Mallette
>            Priority: Major
>
> This bit of Gremlin demonstrates both problems for uses of {{by(String)}}:
> {code}
> gremlin> g.V().valueMap().project('x').by('name')
> java.util.LinkedHashMap cannot be cast to org.apache.tinkerpop.gremlin.structure.Element
> Type ':help' or ':h' for help.
> Display stack trace? [yN]n
> {code}
> First, users typically expect this to work because they figure they are just grabbing a keys value from a {{Map}} and then get the difficult to understand message which doesn't tell you how to resolve. As a side note, the way to resolve is with:
> {code}
> gremlin> g.V().valueMap().project('x').by(select('name'))
> ==>[x:[marko]]
> ==>[x:[stephen]]
> ==>[x:[matthias]]
> ==>[x:[daniel]]
> ==>[x:[gremlin]]
> ==>[x:[tinkergraph]]
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)