Skip to content

Problem creating graph from existing edge collections #223

Description

@pedrocassalpacheco

Code:
networks = ["co", "mg", "ne", "no", "rj", "sul"]
edges = []

for network in networks:
edges_collection_name = network + "_edges"
node_collection_name = network + "_routers"
print
edges.append(EdgeDefinition(edges_collection_name, fromCollections=[node_collection_name], toCollections=[node_collection_name]))

class RSNac1(Graph) :
_edgeDefinitions = edges
_orphanedCollections = []

theGraph = db.createGraph("RSNac1", createCollections=True)

Output:

ValueError Traceback (most recent call last)
in
16 _orphanedCollections = []
17
---> 18 theGraph = db.createGraph("RSNac1", createCollections=True)

/opt/anaconda3/lib/python3.8/site-packages/pyArango/database.py in createGraph(self, name, createCollections, isSmart, numberOfShards, smartGraphAttribute, replicationFactor, writeConcern)
159 for e in graphClass._edgeDefinitions:
160 if not COL.isEdgeCollection(e.edgesCollection):
--> 161 raise ValueError("'%s' is not a defined Edge Collection" % e.edgesCollection)
162 _checkCollectionList(e.fromCollections)
163 _checkCollectionList(e.toCollections)

ValueError: 'co_edges' is not a defined Edge Collection

Data:
db.collections["co_edges"]
ArangoDB collection name: co_edges, id: 6814744, type: edge, status: loaded

What have I tried:
Used example to create collections and graphs. Collections and graphs use class templates. Works
Used the code above where the collection (edge and node) are already on the database. Not that error is a false negavite. The collection is an edge collection

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions