[
https://issues.apache.org/jira/browse/TINKERPOP-2824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17693334#comment-17693334
]
ASF GitHub Bot commented on TINKERPOP-2824:
-------------------------------------------
vkagamlyk commented on code in PR #1843:
URL: https://github.com/apache/tinkerpop/pull/1843#discussion_r1117575914
##########
gremlin-python/src/main/python/tests/structure/io/test_functionalityio.py:
##########
@@ -25,6 +25,34 @@
from gremlin_python.statics import *
+def test_vertex(remote_connection):
+ g = Graph().traversal().withRemote(remote_connection)
+ vertex = g.V(1).next()
+ assert vertex.id == 1
+ assert len(vertex.properties) == 2
+ assert vertex.properties[0].key == 'name'
+ assert vertex.properties[0].value == 'marko'
+ assert vertex.properties[1].key == 'age'
+ assert vertex.properties[1].value == 29
+
+
+def test_vertex_without_properties(remote_connection):
+ g = Graph().traversal().withRemote(remote_connection)
+ vertex = g.with_('materializeProperties', 'tokens').V(1).next()
+ assert vertex.id == 1
+ # empty array for GraphBinary and missing field for GraphSON
+ assert vertex.properties is None or len(vertex.properties) == 0
+
+
+def test_edge(remote_connection):
Review Comment:
added in
https://github.com/apache/tinkerpop/pull/1843/commits/9e9520b1c4aefa027445a351af19900cdd0bdeb9
> Properties on Elements
> ----------------------
>
> Key: TINKERPOP-2824
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2824
> Project: TinkerPop
> Issue Type: Improvement
> Components: dotnet, driver, go, javascript, process, python
> Affects Versions: 3.5.4
> Reporter: Valentyn Kahamlyk
> Assignee: Valentyn Kahamlyk
> Priority: Major
>
> Problem: When a user writes `g.V()` they get back a Vertex object. The
> problem is that depending on the execution context of the traversal, the
> result could be quite different, with or without properties.
> Solution: Implement new finalization strategy DetachStrategy(detachMode,
> properties) where mode is one of ALL, NONE or CUSTOM. `properties` is list of
> properties name, are taken into account only for CUSTOM mode.
> Discussion thread in dev list: [Proposal to handle properties on response
> Elements-Apache Mail
> Archives|https://lists.apache.org/thread/l8rw7ydj7kym8vhtwk50nhbp45ng9986]
> Stephen's thread in dev list: [The Issue of Detachment-Apache Mail
> Archives|https://lists.apache.org/thread/xltcon4zxnwq4fyw2r2126syyrqm8spy]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)