Lookup the rootfole column name.
@@ -179,7 +179,9 @@ def run(input_file: KGTKFiles,
rootcol = int(rootfilecolumn) if rootfilecolumn is not None and rootfilecolumn.isdigit() else root_kr.get_node1_column_index(rootfilecolumn)
elif root_kr.is_node_file:
rootcol = int(rootfilecolumn) if rootfilecolumn is not None and rootfilecolumn.isdigit() else root_kr.get_id_column_index(rootfilecolumn)
- elif rootfilecolumn is None:
+ elif rootfilecolumn is not None:
+ rootcol = int(rootfilecolumn) if rootfilecolumn is not None and rootfilecolumn.isdigit() else root_kr.column_name_map.get(rootfilecolumn, -1)
+ else:
root_kr.close()
raise KGTKException("The root file is neither an edge nor a node file and the root column name was not supplied.")
