diff --git a/CHANGELOG.md b/CHANGELOG.md index da8bf0573624be684d5edc14098d46f099a21ec0..45d340799897e3ff1ce545b7198220e33321c534 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,3 +3,4 @@ ## v2.1.1 * Fixed incorrect hashable id handling on Janusgraph. +* Updated to run on newer versions of gremlin-python, 3.4.3 is the latest compatible version. diff --git a/goblin/fileio/graphson.py b/goblin/fileio/graphson.py index c9932427f281bad1a847f2a30cc55de8f12b3c12..728581b9d0ce71c3323366c48451bde167707fd8 100644 --- a/goblin/fileio/graphson.py +++ b/goblin/fileio/graphson.py @@ -4,12 +4,12 @@ try: except ImportError: import json -from gremlin_python.structure.io import graphson +from gremlin_python.structure.io.graphsonV3d0 import GraphSONWriter from goblin.element import Vertex, Edge, VertexProperty from goblin.manager import ListVertexPropertyManager -writer = graphson.GraphSONWriter() +writer = GraphSONWriter() AdjList = collections.namedtuple("AdjList", "vertex inE outE") @@ -124,4 +124,4 @@ def _prep_vp(prop, value, v, db_name): def _dump_edge(e): - pass \ No newline at end of file + pass diff --git a/goblin/session.py b/goblin/session.py index ca8093a39f8d642ba0b4844db0b0b4f0bdaa389e..1fcf84b66b41650700f3112682ede9ed5a4b42c4 100644 --- a/goblin/session.py +++ b/goblin/session.py @@ -439,8 +439,9 @@ class Session: if not metaprops: metaprops = {} if val is not None: - key = ('k' + str(binding), db_name) - val = ('v' + str(binding), val) + key = db_name + #key = ('k' + str(binding), db_name) + #val = ('v' + str(binding), val) if card: # Maybe use a dict here as a translator if card == Cardinality.list_: diff --git a/requirements.txt b/requirements.txt index 9c677e07032b85dfc6808a91efbc16162c2c3f0a..95de8325376b247fa18c188acd5cdd0523735cf6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,15 +1,16 @@ -#required foir goblin -six==1.10.0 -aenum==1.4.5 -aiohttp==2.3.10 -aiogremlin==3.2.6 +gremlinpython==3.4.3 +aiogremlin==3.3.2 +PyYAML==5.3 +six==1.14.0 +aenum==2.2.3 +aiohttp==3.6.2 inflection==0.3.1 -gremlinpython==3.2.6 -#for goblin testing -pytest-asyncio>=0.8.0 +#for testing +pytest-asyncio>=0.10.0 pytest-cache>=1.0 -pytest-cov>=2.5.1 +pytest-cov>=2.8.1 pytest-pep8>=1.0.6 -pytest>=3.2.1 +pytest>=5.3.4 pytest-timeout>=1.3.4 +coverage==5.0.3 diff --git a/setup.py b/setup.py index 72a2d8feb2f8b5df54c2812865452bc53d800beb..48bb598704350c4eb4f0fae66ccb3bf46d2dacce 100644 --- a/setup.py +++ b/setup.py @@ -35,8 +35,7 @@ setup_requires = [ ] install_requires = [ - 'aiogremlin>=3.2.6', - 'gremlinpython>=3.2.6', + 'aiogremlin>=3.3.2', 'inflection>=0.3.1', ] diff --git a/tests/test_graph.py b/tests/test_graph.py index bda3bf5e6ec756a3d45786078a0e2e3a1894a2d2..9f79457b7cc9f007e228042216f303aef55da32d 100644 --- a/tests/test_graph.py +++ b/tests/test_graph.py @@ -1,6 +1,6 @@ import pytest from aiogremlin import process -from gremlin_python.process.traversal import Binding +from gremlin_python.process.traversal import Binding, T from goblin import driver @@ -12,7 +12,7 @@ async def test_generate_traversal(remote_graph, remote_connection): traversal = g.V().hasLabel(('v1', 'person')) assert isinstance(traversal, process.graph_traversal.AsyncGraphTraversal) - assert traversal.bytecode.bindings['v1'] == 'person' + assert traversal.bytecode.step_instructions[1][1][1] == 'person' @pytest.mark.asyncio @@ -21,8 +21,8 @@ async def test_submit_traversal(remote_graph, remote_connection): resp = g.addV('person').property('name', 'leifur').valueMap(True) leif = await resp.next() assert leif['name'][0] == 'leifur' - assert leif['label'] == 'person' - resp = g.V(Binding('vid', leif['id'])).drop() + assert leif[T.label] == 'person' + resp = g.V(Binding('vid', leif[T.id])).drop() none = await resp.next() assert none is None