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

Function datasource

python/graphscope/gsctl/commands/interactive/glob.py:169–181  ·  view source on GitHub ↗

Bind data source mapping from file

(graph_identifier, filename)

Source from the content-addressed store, hash-verified

167 help="Path of yaml file",
168)
169def datasource(graph_identifier, filename): # noqa: F811
170 """Bind data source mapping from file"""
171 if not is_valid_file_path(filename):
172 err(f"Invalid file: {filename}")
173 return
174 graph_identifier = get_graph_id_by_name(graph_identifier)
175 try:
176 datasource = read_yaml_file(filename)
177 bind_datasource_in_batch(graph_identifier, datasource)
178 except Exception as e:
179 err(f"Failed to bind data source: {str(e)}")
180 else:
181 succ("Bind data source successfully.")
182
183
184@delete.command

Callers

nothing calls this directly

Calls 8

is_valid_file_pathFunction · 0.90
errFunction · 0.90
get_graph_id_by_nameFunction · 0.90
read_yaml_fileFunction · 0.90
bind_datasource_in_batchFunction · 0.90
succFunction · 0.90
unbind_edge_datasourceFunction · 0.90
unbind_vertex_datasourceFunction · 0.90

Tested by

no test coverage detected