MCPcopy Create free account
hub / github.com/alibaba/GraphScope / wrapper

Function wrapper

python/graphscope/framework/app.py:58–76  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

56
57 @functools.wraps(func)
58 def wrapper(*args, **kwargs):
59 graph = args[0]
60 if not hasattr(graph, "graph_type"):
61 raise InvalidArgumentError("Missing graph_type attribute in graph object.")
62 if graph.graph_type == graph_def_pb2.ARROW_PROPERTY:
63 if "weight" in kwargs:
64 # func has 'weight' argument
65 weight = kwargs.get("weight", None)
66 projected = graph._project_to_simple(e_prop=weight)
67 elif "attribute" in kwargs:
68 # func has 'attribute' argument
69 attribute = kwargs.get("attribute", None)
70 projected = graph._project_to_simple(v_prop=attribute)
71 else:
72 projected = graph._project_to_simple()
73 projected._base_graph = graph
74 else:
75 projected = graph
76 return func(projected, *args[1:], **kwargs)
77
78 return wrapper
79

Callers

nothing calls this directly

Calls 5

funcFunction · 0.85
getMethod · 0.65
_project_to_simpleMethod · 0.45
is_directedMethod · 0.45

Tested by

no test coverage detected