From d460202f94c4ca06c1d314c19ad668c5f4f8d70d Mon Sep 17 00:00:00 2001 From: Cody K Yancey Date: Fri, 30 Aug 2024 21:37:12 +0000 Subject: [PATCH] [fasttrackml][aim] Rename Trace Last Value to Values and Turn Off Advanced Mode for Queries from Search Form --- src/src/services/models/explorer/metricsModelMethods.ts | 2 ++ src/src/services/models/explorer/paramsModelMethods.ts | 2 +- src/src/services/models/explorer/runsModelMethods.ts | 2 +- src/src/services/models/explorer/scattersModelMethods.ts | 6 +++--- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/src/services/models/explorer/metricsModelMethods.ts b/src/src/services/models/explorer/metricsModelMethods.ts index b91eaa7b..8721597e 100644 --- a/src/src/services/models/explorer/metricsModelMethods.ts +++ b/src/src/services/models/explorer/metricsModelMethods.ts @@ -1,6 +1,7 @@ import moment from 'moment'; import { saveAs } from 'file-saver'; import _ from 'lodash-es'; +import { config } from 'yargs'; import { IAxesScaleRange } from 'components/AxesPropsPopover'; @@ -303,6 +304,7 @@ function getMetricsAppModelMethods( if (queryString) { configData.select.query = queryString; + configData.select.advancedMode = false; } let metrics = getMetricsListFromSelect(configData?.select); diff --git a/src/src/services/models/explorer/paramsModelMethods.ts b/src/src/services/models/explorer/paramsModelMethods.ts index 6a84ce0f..bfabbe6a 100644 --- a/src/src/services/models/explorer/paramsModelMethods.ts +++ b/src/src/services/models/explorer/paramsModelMethods.ts @@ -396,7 +396,7 @@ function getParamsModelMethods( const metricHash = getMetricHash(trace.name, trace.context); // TODO: Implement Support for the new metric value API format // metricsRowValues[metricHash] = formatValue(trace.values.last); - metricsRowValues[metricHash] = formatValue(trace.last_value.last); + metricsRowValues[metricHash] = formatValue(trace.values.last); }); const rowValues: any = { rowMeta: { diff --git a/src/src/services/models/explorer/runsModelMethods.ts b/src/src/services/models/explorer/runsModelMethods.ts index 7b7b153f..f7f31bcb 100644 --- a/src/src/services/models/explorer/runsModelMethods.ts +++ b/src/src/services/models/explorer/runsModelMethods.ts @@ -714,7 +714,7 @@ function getRunsModelMethods( const metricHash = getMetricHash(trace.name, trace.context); // TODO: Implement Support for the new metric value API format metricsRowValues[metricHash] = formatValue( - trace.last_value.last, + trace.values.last, // trace.values[metricsValueKey], ); }); diff --git a/src/src/services/models/explorer/scattersModelMethods.ts b/src/src/services/models/explorer/scattersModelMethods.ts index 1900e1e8..9735c469 100644 --- a/src/src/services/models/explorer/scattersModelMethods.ts +++ b/src/src/services/models/explorer/scattersModelMethods.ts @@ -389,7 +389,7 @@ function getScattersModelMethods( _.isEqual(trace.context, value?.context) ) { // TODO: Revert this back to trace.values.last; - let lastValue = trace.last_value.last; + let lastValue = trace.values.last; const formattedLastValue = formatValue(lastValue, '-'); values[i] = lastValue; if (formattedLastValue !== '-') { @@ -565,7 +565,7 @@ function getScattersModelMethods( metric.run.traces.metric.forEach((trace: any) => { const metricHash = getMetricHash(trace.name, trace.context as any); // TODO: Implement Support for the new metric value API format - metricsRowValues[metricHash] = formatValue(trace.last_value.last); + metricsRowValues[metricHash] = formatValue(trace.values.last); //metricsRowValues[metricHash] = formatValue(trace.values.last); }); const rowValues: any = { @@ -765,7 +765,7 @@ function getScattersModelMethods( metricsValues[metricHash] = { min: '-', max: '-', - last: traceOldAPI.last_value.last, + last: traceOldAPI.values.last, first: '-', }; });