Hi,
I am currently interested in using Goblin but I have the following issues:
tornado
and certainly other undesired libraries g = traversal().withRemote(DriverRemoteConnection(
url=URL,
traversal_source="g",
username=USERNAME,
password=PASSWORD,
message_serializer=serializer.GraphSONSerializersV2d0(),
))
Also, there are unanswered issues opened for months and no more commit for a year. My questions are therefore:
Thank you for your time. Have a nice day.
I can be active and responsive if you have any PR/MR you will have both in being able to do the proper code review, as well as any releases. I may be able to help with any problems arise as well. But yea, new features or bug fixes will need some community help.
@freemo Hi, thank you for the quick response and its transparency. I am working with CosmosDB which only support the string API, so I first need to contribute to gremlin client first, then come back if I have any improvement proposal to make.
Have a nice day.
Hi, I monitor the project and respond. I am semi-active and it is fairly stable. But as of the moment I am the only developer and no one seems to be contributing. So take it with a grain of salt.
I will happily accept PR addressing any concerns and can actively contribute time.
Hi,
I am currently interested in using Goblin but I have the following issues:
tornado
and certainly other undesired libraries g = traversal().withRemote(DriverRemoteConnection(
url=URL,
traversal_source="g",
username=USERNAME,
password=PASSWORD,
message_serializer=serializer.GraphSONSerializersV2d0(),
))
Also, there are unanswered issues opened for months and no more commit for a year. My questions are therefore:
Thank you for your time. Have a nice day.
Jeffrey Phillips Freeman (52737ad7) at 28 Jul 04:35
Build(deps): Bump aiohttp from 3.6.2 to 3.8.5
I'm attempting to use Goblin against a janusgraph backed, and I've run into an issue. It appears the Goblin can't handle the RelationIdentifier ids of the JanusGraph Edges. RelationIdentifier is a complex type that contains the id within it. I was able to partially work around the issue by setting the get_hashable_id function, but queries fail on session.py:444.
props = await self._g.E(elem.id).valueMap(True).next()
I found I could work around the issue with the following.
if isinstance(elem.id, dict):
props = await self._g.E(elem.id['@value']['relationId']).valueMap(True).next()
else:
props = await self._g.E(elem.id).valueMap(True).next()
I was able to reproduce the problem with a simple script.
import asyncio
import goblin
from goblin import Goblin, Vertex, Edge
from goblin.session import Session
import time
loop = asyncio.get_event_loop()
app = loop.run_until_complete(Goblin.open(loop, hosts=['localhost']))
class Knows(goblin.Edge):
pass
class Person(goblin.Vertex):
pass
async def do_the_thing():
p1 = Person()
p2 = Person()
e1 = Knows(p1, p2)
session: Session = await app.session()
session.add(p1, p2, e1)
await session.flush()
loop.run_until_complete(do_the_thing())
Jeffrey Phillips Freeman (842df8d3) at 13 Mar 11:41
identifying myself for account recover
Jeffrey Phillips Freeman (842df8d3) at 30 Jan 13:04
Jeffrey Phillips Freeman (842df8d3) at 30 Jan 13:04
identifying myself for account recover
Jeffrey Phillips Freeman (842df8d3) at 30 Jan 13:02
identifying myself for account recover
For some reason the db is not clearing between different sessions. This apparently also causes the elements in the graphs to be recognized as generic goblin types instead of the classes I defined. This specific example will pass in the first time then fail in the second (hence the for loop of 2).
import asyncio
import goblin
from goblin import Goblin, Graph, element, properties
class Person(element.Vertex):
name = properties.Property(properties.String)
age = properties.Property(properties.Integer)
class Knows(element.Edge):
notes = properties.Property(properties.String, default='N/A')
async def test_data_clearing(event_loop):
goblin_app = await Goblin.open(
event_loop,
hosts=['localhost'],
port=8182,
provider=goblin.provider.JanusGraph,
)
session = await goblin_app.session()
# check if the db is empty
vertices = await session.g.V().toList()
assert len(vertices) == 0
# create some elements the graph:
leif = Person()
jon = Person()
works_with = Knows(leif, jon)
session.add(leif, jon, works_with)
await session.flush()
result = await session.g.E(works_with.id).next()
assert result is works_with
# check if type of the vertices/edges matches the classes or appear as generic goblin element:
g = Graph().traversal().withRemote(session)
vertices = await g.V().toList()
edges = await g.E().toList()
for vertex in vertices:
assert isinstance(vertex, Person)
for edge in edges:
assert isinstance(edge, Knows)
session.close()
await goblin_app.close()
if __name__ == '__main__':
loop = asyncio.get_event_loop()
for i in range(2):
loop.run_until_complete(test_data_clearing(event_loop=loop))
goblin freeezes when calling session.flush (looks like an infinity loop)
when Im running this following code:
import goblin # type: ignore
from goblin import Graph, Vertex, element, properties, Goblin, provider # type: ignore
import asyncio
class Example(Vertex):
__label__ = 'ex'
id = properties.Property(properties.String)
async def go_test(event_loop):
goblin_app = await Goblin.open(
event_loop,
hosts=['192.168.36.68'],
port=8182,
provider=goblin.provider.JanusGraph,
)
session = await goblin_app.session()
ex1 = Example()
ex1.id = "ABC"
session.add(ex1)
print(1)
await session.flush()
print(2)
g = Graph().traversal().withRemote(session)
vertices = await g.V().toList()
await goblin_app.close()
return vertices
loop = asyncio.get_event_loop()
results = loop.run_until_complete(go_test(event_loop=loop))
It prints 1 and got stock
This is the error i get after canceling it:
1
^CTraceback (most recent call last):
File "/home/hadar/source/hyperspec/hyperspec/graph/test_session_flush.py", line 35, in <module>
results = loop.run_until_complete(go_test(event_loop=loop))
File "/usr/lib/python3.9/asyncio/base_events.py", line 629, in run_until_complete
self.run_forever()
File "/usr/lib/python3.9/asyncio/base_events.py", line 596, in run_forever
self._run_once()
File "/usr/lib/python3.9/asyncio/base_events.py", line 1854, in _run_once
event_list = self._selector.select(timeout)
File "/usr/lib/python3.9/selectors.py", line 469, in select
fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt
Task exception was never retrieved
future: <Task finished name='Task-4' coro=<Connection._receive() done, defined at /home/hadar/.local/lib/python3.9/site-packages/aiogremlin-3.3.5-py3.9.egg/aiogremlin/driver/connection.py:155> exception=AttributeError("'dict' object has no attribute 'decode'")>
Traceback (most recent call last):
File "/home/hadar/.local/lib/python3.9/site-packages/aiogremlin-3.3.5-py3.9.egg/aiogremlin/driver/connection.py", line 158, in _receive
File "/home/hadar/.local/lib/python3.9/site-packages/aiogremlin-3.3.5-py3.9.egg/aiogremlin/driver/protocol.py", line 46, in data_received
File "/home/hadar/.local/lib/python3.9/site-packages/gremlinpython-3.6.0-py3.9.egg/gremlin_python/driver/serializer.py", line 155, in deserialize_message
msg = json.loads(message.decode('utf-8'))
AttributeError: 'dict' object has no attribute 'decode'
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f26344c0220>
Task was destroyed but it is pending!
task: <Task pending name='Task-5' coro=<Connection._terminate_response() running at /home/hadar/.local/lib/python3.9/site-packages/aiogremlin-3.3.5-py3.9.egg/aiogremlin/driver/connection.py:151> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f26344b2b80>()]>>
Task was destroyed but it is pending!
task: <Task pending name='Task-6' coro=<PooledConnection.release_task() running at /home/hadar/.local/lib/python3.9/site-packages/aiogremlin-3.3.5-py3.9.egg/aiogremlin/driver/pool.py:55> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f26344b2d60>()]>>
Jeffrey Phillips Freeman (c98add80) at 13 May 18:47
Merge branch 'master' of git.qoto.org:goblin-ogm/goblin
... and 1 more commit
Jeffrey Phillips Freeman (eb4c6134) at 14 Apr 11:07
Fixed aiohttp version to avoid compatability bug.
... and 1 more commit
Jeffrey Phillips Freeman (ef6afd2c) at 12 Apr 16:28
Fixed the ElementMeta which wasnt properly calling the parent class...
Jeffrey Phillips Freeman (1377cf54) at 10 Apr 19:19
Fixed aiogoblin to work with latest version of tinkerpop.
Jeffrey Phillips Freeman (30722646) at 10 Apr 16:36
Changed Element so it extends from ABC to allow for abstract Elements.
Jeffrey Phillips Freeman (8fec65d7) at 27 Mar 20:01
Added better error handling and fixed g.E() traversal.
Jeffrey Phillips Freeman (afe61fc0) at 27 Mar 18:29
Added support for JanusGraph.