Potential bug report for 3.9.3 MAP attribute problem

For version 3.9.3:

When I call upsertVertex in pyTigergraph,

conn.upsertVertex("Demo", "id", {
    "map_attr": {
    }
})

or,

conn.upsertVertex("Demo", "id", {
    "map_attr": {
        "keylist":["k"],
        "valuelist":["v"]
    }
})

the REST server always return:
(' The payload json value \'keyList\' is not valid, expecting "keylist" or"valuelist”REST-30200)

My schema is like:


VERTEX Demo(
    map_attr MAP<STRING, STRING>
)

Could you please enable debugging and check what parameters are passed to the _post() function that is called by upsertVertex()?

Both pyTigerGraph code and the underlying Python and CPython functions use double quotes to enclose sting (as per the JSON standard), so there should not be single quotes in the payload.

Thanks @Szilard_Barany . I have figured it out after some debug, the problem is in pyTigergraph 1.4.2 and 1.5.

In file [pyTigerGraph/pyTigerGraphSchema.py] line 88

vals[attr] = {"value": {"keyList": list(val.keys()), "valueList": list(val.values())}}

It should be:

vals[attr] = {"value": {"keylist": list(val.keys()), "valuelist": list(val.values())}}

I see, lowercase keys. Thanks for the finding, we will fix it ASAP.

1 Like