Skip to content

Commit

Permalink
feat(lib): add logic in the compute.ts to add explain data in the sto…
Browse files Browse the repository at this point in the history
…rage
  • Loading branch information
manushak committed Jul 16, 2024
1 parent 2e35df3 commit 3a9023a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/if-run/lib/compute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {STRINGS} from '../config/strings';

import {isExecute, isGroupBy} from '../types/interface';
import {ComputeParams, Node, Params} from '../types/compute';
import {addExplainData} from './explain';

const {MERGING_DEFAULTS_WITH_INPUT_DATA, COMPUTING_PIPELINE_FOR_NODE} = STRINGS;

Expand Down Expand Up @@ -78,6 +79,15 @@ const computeNode = async (node: Node, params: Params): Promise<any> => {

if (isExecute(plugin)) {
inputStorage = await plugin.execute(inputStorage, nodeConfig);

if (params.context.explainer) {
addExplainData({
pluginName,
metadata: plugin.metadata,
pluginData: params.context.initialize.plugins[pluginName],
});
}

debugLogger.setExecutingPluginName();

node.outputs = inputStorage;
Expand Down

0 comments on commit 3a9023a

Please sign in to comment.