Skip to content

Commit beb918b

Browse files
committed
Fix test and format code
1 parent 35b5801 commit beb918b

File tree

3 files changed

+3
-39
lines changed

3 files changed

+3
-39
lines changed

graphdatascience/graph/base_graph_proc_runner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import os
24
import pathlib
35
import warnings
@@ -31,7 +33,6 @@
3133
from .graph_type_check import (
3234
from_graph_type_check,
3335
graph_type_check,
34-
graph_type_check_optional,
3536
)
3637
from .ogb_loader import OGBLLoader, OGBNLoader
3738

graphdatascience/graph/graph_type_check.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from functools import wraps
2-
from typing import Any, Callable, Optional, TypeVar, cast
2+
from typing import Any, Callable, TypeVar, cast
33

44
from .graph_object import Graph
55

@@ -20,20 +20,6 @@ def wrapper(self: Any, G: Graph, *args: Any, **kwargs: Any) -> Any:
2020
return cast(F, wrapper)
2121

2222

23-
def graph_type_check_optional(func: F) -> F:
24-
@wraps(func)
25-
def wrapper(self: Any, G: Optional[Graph] = None, *args: Any, **kwargs: Any) -> Any:
26-
if isinstance(G, str):
27-
raise TypeError(
28-
f"The parameter 'G' takes a `Graph` object, but received string '{G}'. "
29-
"To resolve a graph name string into a `Graph` object, please use `gds.graph.get`"
30-
)
31-
32-
return func(self, G, *args, **kwargs)
33-
34-
return cast(F, wrapper)
35-
36-
3723
def from_graph_type_check(func: F) -> F:
3824
@wraps(func)
3925
def wrapper(self: Any, graph_name: str, from_G: Graph, *args: Any, **kwargs: Any) -> Any:

graphdatascience/tests/integration/test_graph_ops.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -228,19 +228,6 @@ def test_graph_drop(gds: GraphDataScience) -> None:
228228
def test_graph_type_check(gds: GraphDataScience) -> None:
229229
G, _ = gds.graph.project(GRAPH_NAME, "*", "*")
230230

231-
# Call without providing optional `Graph` without raising
232-
gds.graph.list()
233-
234-
# Raise when optional `Graph` is string
235-
with pytest.raises(
236-
TypeError,
237-
match=(
238-
f"The parameter 'G' takes a `Graph` object, but received string '{G.name()}'. "
239-
"To resolve a graph name string into a `Graph` object, please use `gds.graph.get`"
240-
),
241-
):
242-
gds.graph.list(G.name()) # type: ignore
243-
244231
# Raise when second positional from_G `Graph` is string
245232
with pytest.raises(
246233
TypeError,
@@ -251,16 +238,6 @@ def test_graph_type_check(gds: GraphDataScience) -> None:
251238
):
252239
gds.beta.graph.project.subgraph("s", G.name(), "n.x > 1", "*", concurrency=2) # type: ignore
253240

254-
# Raise when first positional G `Graph` is string
255-
with pytest.raises(
256-
TypeError,
257-
match=(
258-
f"The parameter 'G' takes a `Graph` object, but received string '{G.name()}'. "
259-
"To resolve a graph name string into a `Graph` object, please use `gds.graph.get`"
260-
),
261-
):
262-
gds.graph.list(G.name()) # type: ignore
263-
264241
result = gds.graph.drop(G, True)
265242
assert result is not None
266243
assert result["graphName"] == GRAPH_NAME

0 commit comments

Comments
 (0)