You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2025/08/04 19:18:36 UTC
(superset) branch 5.0 updated: fix(native filters): throws an error when a chart containing a bigint value (#34539)
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/5.0 by this push:
new ee2a5915b2 fix(native filters): throws an error when a chart containing a bigint value (#34539)
ee2a5915b2 is described below
commit ee2a5915b255fed9e710846fccf579a82d821d80
Author: JUST.in DO IT <ju...@airbnb.com>
AuthorDate: Mon Aug 4 12:17:06 2025 -0700
fix(native filters): throws an error when a chart containing a bigint value (#34539)
(cherry picked from commit 2f8939d229db3b2829e1dd7096875f4fc5196bc1)
---
.../FiltersConfigForm/FiltersConfigForm.tsx | 2 +-
.../FiltersConfigModal/FiltersConfigModal.test.tsx | 44 ++++++++++++++++++++++
2 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx
index 5b843a370b..aed1047086 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx
@@ -754,7 +754,7 @@ const FiltersConfigForm = (
});
return excluded;
}, [
- JSON.stringify(charts),
+ JSON.stringify(Object.values(charts).map(chart => chart.id)),
formFilter?.dataset?.value,
JSON.stringify(loadedDatasets),
]);
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.test.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.test.tsx
index 91bfe6c282..3f5b5e9af7 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.test.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.test.tsx
@@ -76,6 +76,29 @@ const noTemporalColumnsState = () => {
};
};
+const bigIntChartDataState = () => {
+ const state = defaultState();
+ return {
+ ...state,
+ charts: {
+ ...state.charts,
+ 999: {
+ queriesResponse: [
+ {
+ status: 'success',
+ data: [
+ { name: 'Abigail', count: 228 },
+ { name: 'Aaron', count: 123012930123123n },
+ { name: 'Adam', count: 454 },
+ ],
+ applied_filters: [{ column: 'name' }],
+ },
+ ],
+ },
+ },
+ };
+};
+
const datasetResult = (id: number) => ({
description_columns: {},
id,
@@ -583,3 +606,24 @@ test('modifies the name of a filter', async () => {
),
);
});
+
+test('renders a filter with a chart containing BigInt values', async () => {
+ const nativeFilterState = [
+ buildNativeFilter('NATIVE_FILTER-1', 'state', ['NATIVE_FILTER-2']),
+ buildNativeFilter('NATIVE_FILTER-2', 'country', []),
+ buildNativeFilter('NATIVE_FILTER-3', 'product', []),
+ ];
+ const state = {
+ ...bigIntChartDataState(),
+ dashboardInfo: {
+ metadata: { native_filter_configuration: nativeFilterState },
+ },
+ dashboardLayout,
+ };
+ defaultRender(state, {
+ ...props,
+ createNewOnOpen: false,
+ });
+
+ expect(screen.getByText(FILTER_TYPE_REGEX)).toBeInTheDocument();
+});