From 4b6b3b70186fbd3ac1de880fdcea063b0e2c1542 Mon Sep 17 00:00:00 2001 From: Ophir LOJKINE Date: Mon, 23 Oct 2023 10:30:58 +0200 Subject: [PATCH] NodeGraph: Fix edges dataframe miscategorization (#76842) * in node graph, fix edges dataframe miscategorization A dataframe named "edges" could end up getting categorized as a nodes dataframe if it was missing a "source" field, resulting in a very confusing error message "id field is required for nodes dataframe" instead of a more sensible error message about the missing source field. * Fix lint --------- Co-authored-by: Andrej Ocenas --- public/app/plugins/panel/nodeGraph/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/plugins/panel/nodeGraph/utils.ts b/public/app/plugins/panel/nodeGraph/utils.ts index d6d801298f7..695ecdf523c 100644 --- a/public/app/plugins/panel/nodeGraph/utils.ts +++ b/public/app/plugins/panel/nodeGraph/utils.ts @@ -607,7 +607,7 @@ export const getGraphFrame = (frames: DataFrame[]) => { return frames.reduce( (acc, frame) => { const sourceField = frame.fields.filter((f) => f.name === 'source'); - if (sourceField.length) { + if (frame.name === 'edges' || sourceField.length) { acc.edges.push(frame); } else { acc.nodes.push(frame);