Skip to content

Commit

Permalink
fix: mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
aMahanna committed Jul 4, 2023
1 parent 7b61e38 commit f8c2591
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions tests/test_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,13 +657,15 @@ def test_adb_graph_to_pyg_to_arangodb_with_missing_document_and_strict(

ADBPyG_Adapter(db).pyg_to_arangodb(name, data)

arango_graph = db.graph(name)
v_cols = arango_graph.vertex_collections()
graph = db.graph(name)
v_cols: Set[str] = graph.vertex_collections() # type: ignore
edge_definitions: List[Json] = graph.edge_definitions() # type: ignore
e_cols: Set[str] = {c["edge_collection"] for c in edge_definitions}

for v_col in v_cols:
vertex_collection = db.collection(v_col)
vertex_collection.delete("0")

e_cols = {col["edge_collection"] for col in arango_graph.edge_definitions()}
metagraph: ADBMetagraph = {
"vertexCollections": {col: {} for col in v_cols},
"edgeCollections": {col: {} for col in e_cols},
Expand All @@ -685,21 +687,24 @@ def test_adb_graph_to_pyg_to_arangodb_with_missing_document_and_permissive(

ADBPyG_Adapter(db).pyg_to_arangodb(name, data)

arango_graph = db.graph(name)
v_cols = arango_graph.vertex_collections()
graph = db.graph(name)
v_cols: Set[str] = graph.vertex_collections() # type: ignore
edge_definitions: List[Json] = graph.edge_definitions() # type: ignore
e_cols: Set[str] = {c["edge_collection"] for c in edge_definitions}

for v_col in v_cols:
vertex_collection = db.collection(v_col)
vertex_collection.delete("0")

e_cols = {col["edge_collection"] for col in arango_graph.edge_definitions()}
metagraph: ADBMetagraph = {
"vertexCollections": {col: {} for col in v_cols},
"edgeCollections": {col: {} for col in e_cols},
}

data = adapter.arangodb_to_pyg(name, metagraph=metagraph, strict=False)

assert len(data.edge_index[0]) < db.collection(list(e_cols)[0]).count()
collection_count: int = db.collection(list(e_cols)[0]).count() # type: ignore
assert len(data.edge_index[0]) < collection_count

db.delete_graph(name, drop_collections=True)

Expand Down

0 comments on commit f8c2591

Please sign in to comment.