gremlin python检索ID和标签(valueMap(True))

gremlin python检索ID和标签(valueMap(True)),python,python-3.x,gremlin,tinkerpop3,amazon-neptune,Python,Python 3.x,Gremlin,Tinkerpop3,Amazon Neptune,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/mer

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__
 ...
g.V('test_red1').valueMap(True).toList()
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/home/ec2 user/environment/merchantGraph/gremlin_python/process/traversal.py”,第52行,在toList中
返回清单(国际热核实验堆(自行))
文件“/home/ec2 user/environment/merchantGraph/gremlin_python/process/traversal.py”,第43行,下一行__
...
我错过了什么吗。我用的是AWS海王星

我正在添加额外的导入语句

和回溯

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'
导入时间
导入请求
导入json
从gremlin_python导入静态
从gremlin_python.structure.graph导入图形
从gremlin_python.process.graph_遍历导入__
从gremlin_python.process.strategies导入*
从gremlin_python.driver.driver_remote_连接导入DriverRemoteConnection
进口boto3
从操作系统导入环境
图=图()
g=graph.traversal().withRemote(DriverRemoteConnection(environ['gremlineptuneConnection'],'g'))
#这很有效
g、 V('test_red1').valueMap().toList()
#这失败了
g、 V('test_red1')。valueMap(True)。toList()
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/home/ec2 user/environment/merchantGraph/gremlin_python/process/traversal.py”,第52行,在toList中
返回清单(国际热核实验堆(自行))
....
objectify中的文件“/home/ec2 user/environment/merchantGraph/gremlin_python/structure/io/graphsonV3d0.py”,第455行
new_dict[reader.toObject(l[x])]=reader.toObject(l[x+1])
TypeError:无法损坏的类型:“dict”

我猜您最近报告了一个带有
valueMap(true)
的bug,您可能遇到了麻烦:

它已修补,将在3.3.2版本中修复。在那之前,你必须解决这个问题,因为除了恢复到GraphSON 2.0(它有自己的一系列缺点)之外,真的没有解决办法。一种解决方法是
project()
您的结果:

gremlin> g.V().project('props','id','label').
......1>         by(valueMap()).
......2>         by(id).
......3>         by(label)
==>[props:[name:[marko],age:[29]],id:1,label:person]
==>[props:[name:[vadas],age:[27]],id:2,label:person]
==>[props:[name:[lop],lang:[java]],id:3,label:software]
==>[props:[name:[josh],age:[32]],id:4,label:person]
==>[props:[name:[ripple],lang:[java]],id:5,label:software]
==>[props:[name:[peter],age:[35]],id:6,label:person]

你确实错过了一些东西——一个。什么是g?你预计会发生什么?剩下的追踪结果呢?