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

Function get_graph_id_by_name

python/graphscope/gsctl/impl/graph.py:126–142  ·  view source on GitHub ↗
(name_or_id: str)

Source from the content-addressed store, hash-verified

124
125
126def get_graph_id_by_name(name_or_id: str):
127 graphs = list_graphs()
128 id_candidate = []
129 for g in graphs:
130 if name_or_id == g.id:
131 return name_or_id
132 if name_or_id == g.name:
133 id_candidate.append(g.id)
134 if not id_candidate:
135 raise RuntimeError(
136 f"Graph '{name_or_id}' not exists, see graph information with `ls` command."
137 )
138 if len(id_candidate) > 1:
139 raise RuntimeError(
140 f"Found multiple id candidates {id_candidate} for graph {name_or_id}, please choose one."
141 )
142 return id_candidate[0]
143
144
145def get_graph_name_by_id(graph_identifier: str):

Callers 7

useFunction · 0.90
datasourceFunction · 0.90
loaderjobFunction · 0.90
useFunction · 0.90
graphFunction · 0.90
datasourceFunction · 0.90
loaderjobFunction · 0.90

Calls 2

list_graphsFunction · 0.70
appendMethod · 0.65

Tested by

no test coverage detected