Bind data source mapping from file
(graph_identifier, filename)
| 167 | help="Path of yaml file", |
| 168 | ) |
| 169 | def 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 |
nothing calls this directly
no test coverage detected