kube-arangodb
kube-arangodb copied to clipboard
how to get indexes of edge
I just create a graph following this: https://github.com/ArangoDB-Community/pyArango/blob/master/examples/createSocialGraph.py I operate with pyArango, and when I try to get the indexes of the collection 'relation', I meet a problem
relation=db.collections['relation']
relation.getIndexes()
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.8/site-packages/pyArango/collection.py", line 271, in getIndexes self.indexes[ind["type"]][ind["id"]] = Index(collection = self, infos = ind) KeyError: 'edge'
How to solve this problem?
Besides, I think it could be better if more information can be given when exception is met.
For example, when I import data with importBulk, and there is illegal key in the data:
db.importBulk(vertices_list, onDuplicate='ignore', ignoreError=True)
It will go wrong:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/XSASE-TrustEngine/pyArango_utils.py", line 125, in load_data_from_csv self.insert_batch_edges_and_vertices(clp, edges, vertex_set, reverse) File "/opt/XSASE-TrustEngine/pyArango_utils.py", line 84, in insert_batch_edges_and_vertices res = vertex_db.importBulk(vertices_list, onDuplicate='ignore') File "/usr/local/lib/python3.8/site-packages/pyArango/collection.py", line 319, in importBulk raise CreationError(data["errorMessage"], data) pyArango.theExceptions.CreationError: illegal document key. Errors: {'code': 400, 'error': True, 'errorMessage': 'illegal document key', 'errorNum': 1221}
But I don't know what the illegal key is. In addition, I find the param 'ignoreError' does not work, could you please teach me how to use it? Thank you!