【发布时间】:2018-01-19 23:13:52
【问题描述】:
python g.V('test_red1').valueMap().toList()
工作正常,但是当我将 true 传递给请求 ID 和标签时,我收到此错误。我有什么遗漏吗?
g.V('test_red1').valueMap(True).toList()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ec2-user/environment/merchantGraph/gremlin_python/process/traversal.py", line 52, in toList
return list(iter(self))
File "/home/ec2-user/environment/merchantGraph/gremlin_python/process/traversal.py", line 43, in __next__
...
我是不是错过了什么。我正在使用 AWS Neptune ...
我正在添加额外的导入语句
和追溯
import time
import requests
import json
from gremlin_python import statics
from gremlin_python.structure.graph import Graph
from gremlin_python.process.graph_traversal import __
from gremlin_python.process.strategies import *
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
import boto3
from os import environ
graph = Graph()
g = graph.traversal().withRemote(DriverRemoteConnection(environ['gremlinNeptuneConnection'],'g'))
# this works
g.V('test_red1').valueMap().toList()
# this fails
g.V('test_red1').valueMap(True).toList()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ec2-user/environment/merchantGraph/gremlin_python/process/traversal.py", line 52, in toList
return list(iter(self))
....
File "/home/ec2-user/environment/merchantGraph/gremlin_python/structure/io/graphsonV3d0.py", line 455, in objectify
new_dict[reader.toObject(l[x])] = reader.toObject(l[x + 1])
TypeError: unhashable type: 'dict'
【问题讨论】:
-
你确实遗漏了一些东西——minimum, complete, and verifiable example。什么是克?你期望会发生什么?其余的回溯在哪里?
标签: python python-3.x gremlin tinkerpop3 amazon-neptune