(*args, **kwargs)
| 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 |
nothing calls this directly
no test coverage detected