tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [16/16] tinkerpop git commit: TINKERPOP-1860 Added deserializer for T in gremlin-python
Date Mon, 08 Jan 2018 14:19:57 GMT
TINKERPOP-1860 Added deserializer for T in gremlin-python

This allowed valueMap(true) to start working.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/6f1b8be8
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/6f1b8be8
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/6f1b8be8

Branch: refs/heads/TINKERPOP-1860-master
Commit: 6f1b8be8ea28908de60ee4df4c201d15b755ab4a
Parents: 13f1adb
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Mon Jan 8 09:19:00 2018 -0500
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Mon Jan 8 09:19:00 2018 -0500

----------------------------------------------------------------------
 .../gremlin_python/structure/io/graphsonV3d0.py | 10 +++++++-
 gremlin-test/features/map/ValueMap.feature      | 24 ++++++++++----------
 2 files changed, 21 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6f1b8be8/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py
index 265b227..5539448 100644
--- a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py
+++ b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py
@@ -27,7 +27,7 @@ from aenum import Enum
 
 from gremlin_python import statics
 from gremlin_python.statics import FloatType, FunctionType, IntType, LongType, TypeType,
DictType, ListType, SetType
-from gremlin_python.process.traversal import Binding, Bytecode, P, Traversal, Traverser,
TraversalStrategy
+from gremlin_python.process.traversal import Binding, Bytecode, P, Traversal, Traverser,
TraversalStrategy, T
 from gremlin_python.structure.graph import Edge, Property, Vertex, VertexProperty, Path
 
 # When we fall back to a superclass's serializer, we iterate over this map.
@@ -534,3 +534,11 @@ class PathDeserializer(_GraphSONTypeIO):
     @classmethod
     def objectify(cls, d, reader):
         return Path(reader.toObject(d["labels"]), reader.toObject(d["objects"]))
+
+
+class TDeserializer(_GraphSONTypeIO):
+    graphson_type = "g:T"
+
+    @classmethod
+    def objectify(cls, d, reader):
+        return T[d]

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6f1b8be8/gremlin-test/features/map/ValueMap.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/ValueMap.feature b/gremlin-test/features/map/ValueMap.feature
index 0860b15..c851e53 100644
--- a/gremlin-test/features/map/ValueMap.feature
+++ b/gremlin-test/features/map/ValueMap.feature
@@ -42,12 +42,12 @@ Feature: Step - valueMap()
     When iterated to list
     Then the result should be unordered
       | result |
-      | m[{"id": "v[marko].id", "label": "person", "name": ["marko"], "age": [29]}] |
-      | m[{"id": "v[josh].id", "label": "person", "name": ["josh"], "age": [32]}] |
-      | m[{"id": "v[peter].id", "label": "person", "name": ["peter"], "age": [35]}] |
-      | m[{"id": "v[vadas].id", "label": "person", "name": ["vadas"], "age": [27]}] |
-      | m[{"id": "v[lop].id", "label": "software", "name": ["lop"], "lang": ["java"]}] |
-      | m[{"id": "v[ripple].id", "label": "software", "name": ["ripple"], "lang": ["java"]}]
|
+      | m[{"t[id]": "v[marko].id", "t[label]": "person", "name": ["marko"], "age": [29]}]
|
+      | m[{"t[id]": "v[josh].id", "t[label]": "person", "name": ["josh"], "age": [32]}] |
+      | m[{"t[id]": "v[peter].id", "t[label]": "person", "name": ["peter"], "age": [35]}]
|
+      | m[{"t[id]": "v[vadas].id", "t[label]": "person", "name": ["vadas"], "age": [27]}]
|
+      | m[{"t[id]": "v[lop].id", "t[label]": "software", "name": ["lop"], "lang": ["java"]}]
|
+      | m[{"t[id]": "v[ripple].id", "t[label]": "software", "name": ["ripple"], "lang": ["java"]}]
|
 
   Scenario: g_V_valueMapXname_ageX
     Given the modern graph
@@ -74,12 +74,12 @@ Feature: Step - valueMap()
     When iterated to list
     Then the result should be unordered
       | result |
-      | m[{"id": "v[marko].id", "label": "person", "name": ["marko"], "age": [29]}] |
-      | m[{"id": "v[josh].id", "label": "person", "name": ["josh"], "age": [32]}] |
-      | m[{"id": "v[peter].id", "label": "person", "name": ["peter"], "age": [35]}] |
-      | m[{"id": "v[vadas].id", "label": "person", "name": ["vadas"], "age": [27]}] |
-      | m[{"id": "v[lop].id", "label": "software", "name": ["lop"]}] |
-      | m[{"id": "v[ripple].id", "label": "software", "name": ["ripple"]}] |
+      | m[{"t[id]": "v[marko].id", "t[label]": "person", "name": ["marko"], "age": [29]}]
|
+      | m[{"t[id]": "v[josh].id", "t[label]": "person", "name": ["josh"], "age": [32]}] |
+      | m[{"t[id]": "v[peter].id", "t[label]": "person", "name": ["peter"], "age": [35]}]
|
+      | m[{"t[id]": "v[vadas].id", "t[label]": "person", "name": ["vadas"], "age": [27]}]
|
+      | m[{"t[id]": "v[lop].id", "t[label]": "software", "name": ["lop"]}] |
+      | m[{"t[id]": "v[ripple].id", "t[label]": "software", "name": ["ripple"]}] |
 
   Scenario: g_VX1X_outXcreatedX_valueMap
     Given the modern graph


Mime
View raw message