【发布时间】:2022-12-06 03:23:10
【问题描述】:
如果您使用 AWS 在此处提供的代码发出签名请求:https://docs.aws.amazon.com/neptune/latest/userguide/iam-auth-connecting-python.html
然后,如果您从 python 脚本执行这样的查询:
make_signed_request(query="g.V().limit(10).valueMap(true).toList()")
它会输出一个丑陋的无法使用的东西,如下所示:
{
"requestId": "bf942e84-ff49-42c7-a65c-ef43f45g5h63",
"status": {
"message": "",
"code": 200,
"attributes": {
"@type": "g:Map",
"@value": []
}
},
"result": {
"data": {
"@type": "g:List",
"@value": [
{
"@type": "g:Map",
"@value": [
"names",
{
"@type": "g:List",
"@value": ["David Bowie"]
}
..., etc.
而如果我在笔记本上运行相同的查询,如下所示:
%%gremlin --store-to foo
g.V().limit(10).valueMap(true).toList()
然后 foo 是一个格式很好的字典列表,如下所示:
[
{'names': ['David Bowie'], 'dob': [08-01-1947]},
{'names': ['Michael Jackson'], 'dob': [29-08-1958]},
]
如何让 maked_signed_request 函数以与笔记本相同的方式返回数据?
【问题讨论】: