[ 
https://issues.apache.org/jira/browse/TINKERPOP-3119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stephen Mallette closed TINKERPOP-3119.
---------------------------------------
    Fix Version/s: 4.0.0
         Assignee: Stephen Mallette
       Resolution: Done

> Have the gremlin_python Vertex class support key-value access of individual 
> properties
> --------------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-3119
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3119
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: python
>    Affects Versions: 3.7.3
>            Reporter: Matt C. Wilson
>            Assignee: Stephen Mallette
>            Priority: Minor
>             Fix For: 4.0.0
>
>
> The gremlin_python `{{Element}}` class (and thus all Graph object subclasses) 
> has a `{{properties}}` property that must be iterated and each member 
> inspected to find a particular property by name.
> [https://github.com/apache/tinkerpop/blob/8aad0bc72a1d11791ddbd5070962caa23223bf3d/gremlin-python/src/main/python/gremlin_python/structure/graph.py#L29-L39|https://github.com/apache/tinkerpop/blob/master/gremlin-python/src/main/python/gremlin_python/structure/graph.py]
> Example: 
> {{for vp in vertex.properties:}}
> {{  if vp.key == key:}}
> {{    logging.debug(f"\vertex.properties['\\key']: \vp.value")}}
> {{    return vp.value}}
> It would be nice to be able to do:
> {{p = vertex.properties}}
> {{return vertex[key] if p and p.hasattr(key) else None}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to