Skip to content

Commit 7d32fb4

Browse files
danielseong1mlflow-app[bot]Daniel Seongclaude
authored
MLflow UI sync (mlflow#18945)
Signed-off-by: daniel-seong_data <[email protected]> Signed-off-by: Daniel Seong <[email protected]> Co-authored-by: MLflow App <mlflow-app[bot]@users.noreply.github.com> Co-authored-by: Daniel Seong <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent 7e4b775 commit 7d32fb4

File tree

162 files changed

+12100
-1560
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+12100
-1560
lines changed

mlflow/server/js/src/common/utils/FeatureUtils.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ export const shouldEnableGraphQLSampledMetrics = () => false;
4242
export const shouldEnableGraphQLModelVersionsForRunDetails = () => false;
4343
export const shouldRerunExperimentUISeeding = () => false;
4444

45+
/**
46+
* Feature flag to enable Scorers UI tab in experiment page
47+
*/
48+
export const enableScorersUI = () => {
49+
return false;
50+
};
51+
52+
/**
53+
* Determines if running scorers feature is enabled (ability to run LLM scorers on sample traces)
54+
*/
55+
export const isRunningScorersEnabled = () => {
56+
return false;
57+
};
58+
4559
/**
4660
* Determines if experiment kind inference is enabled.
4761
*/

mlflow/server/js/src/common/utils/FetchUtils.ts

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
import cookie from 'cookie';
99
import JsonBigInt from 'json-bigint';
1010
import yaml from 'js-yaml';
11-
import { pickBy } from 'lodash';
11+
import { isNil, pickBy } from 'lodash';
1212
import { ErrorWrapper } from './ErrorWrapper';
1313
import { matchPredefinedError } from '@databricks/web-shared/errors';
14+
import { matchPredefinedErrorFromResponse } from '@databricks/web-shared/errors';
1415

1516
export const HTTPMethods = {
1617
GET: 'GET',
@@ -452,11 +453,18 @@ function serializeRequestBody(payload: any | FormData | Blob) {
452453
: JSON.stringify(payload);
453454
}
454455

456+
// Helper method to make a request to the backend.
455457
export const fetchAPI = async (url: string, method: 'POST' | 'GET' | 'PATCH' | 'DELETE' = 'GET', body?: any) => {
456-
const response = await fetch(url, {
458+
// eslint-disable-next-line no-restricted-globals
459+
const fetchFn = fetch;
460+
const headers = {
461+
...(body ? { 'Content-Type': 'application/json' } : {}),
462+
...getDefaultHeaders(document.cookie),
463+
};
464+
const response = await fetchFn(url, {
457465
method,
458466
body: serializeRequestBody(body),
459-
headers: body ? { 'Content-Type': 'application/json' } : {},
467+
headers,
460468
});
461469
if (!response.ok) {
462470
const predefinedError = matchPredefinedError(response);
@@ -473,3 +481,21 @@ export const fetchAPI = async (url: string, method: 'POST' | 'GET' | 'PATCH' | '
473481
}
474482
return response.json();
475483
};
484+
/**
485+
* Wrapper around fetch that throws on non-OK responses
486+
* Returns the Response object for further processing (.json(), .text(), etc.)
487+
*
488+
* @param input - URL or Request object
489+
* @param options - Fetch options
490+
* @returns Response object if successful
491+
* @throws PredefinedError (NotFoundError, PermissionError, etc.) if response is not OK
492+
*/
493+
export async function fetchOrFail(input: RequestInfo | URL, options?: RequestInit): Promise<Response> {
494+
// eslint-disable-next-line no-restricted-globals -- See go/spog-fetch
495+
const response = await fetch(input, options);
496+
if (!response.ok) {
497+
const error = matchPredefinedErrorFromResponse(response);
498+
throw error;
499+
}
500+
return response;
501+
}

mlflow/server/js/src/experiment-tracking/components/MetricsPlotPanel.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,10 @@ import {
2626
} from '../utils/MetricsUtils';
2727
import type { Location, NavigateFunction } from '../../common/utils/RoutingUtils';
2828
import { RunsChartsCard } from './runs-charts/components/cards/RunsChartsCard';
29-
import {
30-
RunsChartsCardConfig,
31-
RunsChartsLineCardConfig,
32-
RunsChartsLineChartYAxisType,
33-
RunsChartType,
34-
} from './runs-charts/runs-charts.types';
35-
import { RunsChartsRunData, RunsChartsLineChartXAxisType } from './runs-charts/components/RunsCharts.common';
29+
import type { RunsChartsLineCardConfig } from './runs-charts/runs-charts.types';
30+
import { RunsChartsCardConfig, RunsChartsLineChartYAxisType, RunsChartType } from './runs-charts/runs-charts.types';
31+
import type { RunsChartsRunData } from './runs-charts/components/RunsCharts.common';
32+
import { RunsChartsLineChartXAxisType } from './runs-charts/components/RunsCharts.common';
3633
import { RunsChartsTooltipWrapper } from './runs-charts/hooks/useRunsChartsTooltip';
3734
import { RunsChartsTooltipBody } from './runs-charts/components/RunsChartsTooltipBody';
3835
import { RunsChartsFullScreenModal } from './runs-charts/components/RunsChartsFullScreenModal';

0 commit comments

Comments
 (0)