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 <mr.ocenas@gmail.com>
pull/76944/head
Ophir LOJKINE 2 years ago committed by GitHub
parent a26318714f
commit 4b6b3b7018
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      public/app/plugins/panel/nodeGraph/utils.ts

@ -607,7 +607,7 @@ export const getGraphFrame = (frames: DataFrame[]) => {
return frames.reduce<GraphFrame>(
(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);

Loading…
Cancel
Save