Skip to content

Commit 56d74fd

Browse files
committed
remove: graph provision functionality
#207 (comment)
1 parent 56d129f commit 56d74fd

File tree

2 files changed

+1
-67
lines changed

2 files changed

+1
-67
lines changed

arango/database.py

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,6 @@ def create_graph(
11701170
shard_count: Optional[int] = None,
11711171
replication_factor: Optional[int] = None,
11721172
write_concern: Optional[int] = None,
1173-
collections: Optional[Json] = None,
11741173
) -> Result[Graph]:
11751174
"""Create a new graph.
11761175
@@ -1236,32 +1235,6 @@ def create_graph(
12361235
'to_vertex_collections': ['lectures']
12371236
}
12381237
]
1239-
1240-
Here is an example entry for parameter **collections**:
1241-
TODO: Rework **collections** data structure?
1242-
.. code-block:: python
1243-
1244-
{
1245-
'teachers': {
1246-
'docs': teacher_vertices_to_insert
1247-
'options': {
1248-
'overwrite' = True,
1249-
'sync' = True,
1250-
'batch_size' = 50
1251-
}
1252-
},
1253-
'lectures': {
1254-
'docs': lecture_vertices_to_insert
1255-
'options': {
1256-
'overwrite' = False,
1257-
'sync' = False,
1258-
'batch_size' = 4
1259-
}
1260-
},
1261-
'teach': {
1262-
'docs': teach_edges_to_insert
1263-
}
1264-
}
12651238
"""
12661239
data: Json = {"name": name, "options": dict()}
12671240
if edge_definitions is not None:
@@ -1295,15 +1268,7 @@ def response_handler(resp: Response) -> Graph:
12951268
return Graph(self._conn, self._executor, name)
12961269
raise GraphCreateError(resp, request)
12971270

1298-
graph = self._execute(request, response_handler)
1299-
1300-
if collections is not None:
1301-
for name, data in collections.items():
1302-
self.collection(name).import_bulk(
1303-
data["docs"], **data.get("options", {})
1304-
)
1305-
1306-
return graph
1271+
return self._execute(request, response_handler)
13071272

13081273
def delete_graph(
13091274
self,

tests/test_graph.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -57,37 +57,6 @@ def test_graph_properties(graph, bad_graph, db):
5757
assert isinstance(properties["revision"], str)
5858

5959

60-
def test_graph_provision(graph, db):
61-
vertices = [{"_key": str(i)} for i in range(1, 101)]
62-
edges = [
63-
{"_from": f"numbers/{j}", "_to": f"numbers/{i}", "result": j / i}
64-
for i in range(1, 101)
65-
for j in range(1, 101)
66-
if j % i == 0
67-
]
68-
e_d = [
69-
{
70-
"edge_collection": "is_divisible_by",
71-
"from_vertex_collections": ["numbers"],
72-
"to_vertex_collections": ["numbers"],
73-
}
74-
]
75-
76-
name = "divisibility-graph"
77-
db.delete_graph(name, drop_collections=True, ignore_missing=True)
78-
graph = db.create_graph(
79-
name=name,
80-
edge_definitions=e_d,
81-
collections={
82-
"numbers": {"docs": vertices, "options": {"batch_size": 5}},
83-
"is_divisible_by": {"docs": edges, "options": {"sync": True}},
84-
},
85-
)
86-
87-
assert graph.vertex_collection("numbers").count() == len(vertices)
88-
assert graph.edge_collection("is_divisible_by").count() == len(edges)
89-
90-
9160
def test_graph_management(db, bad_db):
9261
# Test create graph
9362
graph_name = generate_graph_name()

0 commit comments

Comments
 (0)