From 3a9023a07b40fa269f568a17793c95a38c45a3d4 Mon Sep 17 00:00:00 2001 From: manushak Date: Tue, 16 Jul 2024 10:48:48 +0400 Subject: [PATCH] feat(lib): add logic in the compute.ts to add explain data in the storage --- src/if-run/lib/compute.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/if-run/lib/compute.ts b/src/if-run/lib/compute.ts index dde49d3f7..02cc8e0e4 100644 --- a/src/if-run/lib/compute.ts +++ b/src/if-run/lib/compute.ts @@ -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; @@ -78,6 +79,15 @@ const computeNode = async (node: Node, params: Params): Promise => { 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;