Skip to content

Commit 353a878

Browse files
authored
Fix server side filtering when the performance toggle is OFF (kubeflow#2108)
Signed-off-by: ppadti <ppadti@redhat.com>
1 parent bd390bd commit 353a878

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

clients/ui/frontend/src/app/pages/modelCatalog/screens/PerformanceInsightsView.tsx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ const PerformanceInsightsView: React.FC<PerformanceInsightsViewProps> = ({ model
4242
filterData,
4343
filterOptions,
4444
filterOptionsLoaded,
45-
performanceViewEnabled,
4645
setPerformanceFiltersChangedOnDetailsPage,
4746
setFilterData,
4847
} = React.useContext(ModelCatalogContext);
@@ -72,20 +71,16 @@ const PerformanceInsightsView: React.FC<PerformanceInsightsViewProps> = ({ model
7271
}, [filterOptionsLoaded]);
7372

7473
// Get performance-specific filter params for the /performance_artifacts endpoint
75-
// Only apply performance filters when toggle is ON
76-
const targetRPS = performanceViewEnabled
77-
? filterData[ModelCatalogNumberFilterKey.MAX_RPS]
78-
: undefined;
74+
const targetRPS = filterData[ModelCatalogNumberFilterKey.MAX_RPS];
75+
7976
// Get full filter key and convert to short property key for the catalog API
80-
const latencyFieldName = performanceViewEnabled
81-
? getActiveLatencyFieldName(filterData)
82-
: undefined;
77+
const latencyFieldName = getActiveLatencyFieldName(filterData);
78+
8379
const latencyProperty = latencyFieldName
8480
? parseLatencyFilterKey(latencyFieldName).propertyKey
8581
: undefined;
8682

8783
// Fetch performance artifacts from server with filtering/sorting/pagination
88-
// When toggle is OFF, don't pass filterData so no perf filters are applied
8984
const [performanceArtifactsList, performanceArtifactsLoaded, performanceArtifactsError] =
9085
useCatalogPerformanceArtifacts(
9186
decodedParams.sourceId || '',
@@ -98,8 +93,8 @@ const PerformanceInsightsView: React.FC<PerformanceInsightsViewProps> = ({ model
9893
// we need to implement proper cursor-based pagination in the performance artifacts table.
9994
pageSize: '99999',
10095
},
101-
performanceViewEnabled ? filterData : undefined,
102-
performanceViewEnabled ? filterOptions : undefined,
96+
filterData,
97+
filterOptions,
10398
);
10499

105100
React.useEffect(() => {

0 commit comments

Comments
 (0)