Goblin OGM issueshttps://git.qoto.org/groups/goblin-ogm/-/issues2023-05-06T06:07:15Zhttps://git.qoto.org/goblin-ogm/goblin/-/issues/3Fails to save edges into janusgraph2023-05-06T06:07:15ZBrian BlonskiFails to save edges into janusgraphI'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...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())
```https://git.qoto.org/goblin-ogm/goblin/-/issues/2db not clearing between sessions2022-05-24T10:43:59ZHen Faingershdb not clearing between sessionsFor 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 f...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))
```https://git.qoto.org/goblin-ogm/goblin/-/issues/1goblin freeezes when calling session.flush2022-05-23T11:56:08ZHadar Sharvitgoblin freeezes when calling session.flushgoblin 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
im...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>()]>>
```https://git.qoto.org/goblin-ogm/aiogremlin/-/issues/3Gitter link on README.md is broken2020-08-10T18:17:10ZGuy RozendornGitter link on README.md is brokenhttps://git.qoto.org/goblin-ogm/aiogremlin/-/issues/2Add support for custom request headers2020-08-10T18:15:12ZGuy RozendornAdd support for custom request headersSimilar to [the same issue in pythongremlin](https://github.com/apache/tinkerpop/commit/29e61312905301cb8f4f32469ab712821705ecf5), please add support for custom request headers.
This is needed for communicating with Neptune clusters wit...Similar to [the same issue in pythongremlin](https://github.com/apache/tinkerpop/commit/29e61312905301cb8f4f32469ab712821705ecf5), please add support for custom request headers.
This is needed for communicating with Neptune clusters with authentication enabled.