This is an automated email from the ASF dual-hosted git repository.
vavila pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new f7b7aace38 fix(export): Full CSV/Excel exports respecting SQL_MAX_ROW
config (#33214)
f7b7aace38 is described below
commit f7b7aace387d2a80309f342788656c9b0893aef1
Author: Vitor Avila <[email protected]>
AuthorDate: Wed Apr 23 13:13:07 2025 -0300
fix(export): Full CSV/Excel exports respecting SQL_MAX_ROW config (#33214)
---
.../src/dashboard/components/gridComponents/Chart.jsx | 7 ++++---
.../src/dashboard/components/gridComponents/Chart.test.jsx | 4 ++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git
a/superset-frontend/src/dashboard/components/gridComponents/Chart.jsx
b/superset-frontend/src/dashboard/components/gridComponents/Chart.jsx
index b7c7785d3e..299f329b67 100644
--- a/superset-frontend/src/dashboard/components/gridComponents/Chart.jsx
+++ b/superset-frontend/src/dashboard/components/gridComponents/Chart.jsx
@@ -150,6 +150,9 @@ const Chart = props => {
const emitCrossFilters = useSelector(
state => !!state.dashboardInfo.crossFiltersEnabled,
);
+ const maxRows = useSelector(
+ state => state.dashboardInfo.common.conf.SQL_MAX_ROW,
+ );
const datasource = useSelector(
state =>
(chart &&
@@ -360,9 +363,7 @@ const Chart = props => {
is_cached: props.isCached,
});
exportChart({
- formData: isFullCSV
- ? { ...formData, row_limit: props.maxRows }
- : formData,
+ formData: isFullCSV ? { ...formData, row_limit: maxRows } : formData,
resultType: isPivot ? 'post_processed' : 'full',
resultFormat: format,
force: true,
diff --git
a/superset-frontend/src/dashboard/components/gridComponents/Chart.test.jsx
b/superset-frontend/src/dashboard/components/gridComponents/Chart.test.jsx
index 3d4cb66bdc..950f3dacc1 100644
--- a/superset-frontend/src/dashboard/components/gridComponents/Chart.test.jsx
+++ b/superset-frontend/src/dashboard/components/gridComponents/Chart.test.jsx
@@ -34,7 +34,7 @@ const props = {
height: 100,
updateSliceName() {},
// from redux
- maxRows: 666,
+ maxRows: 500, // will be overwritten with SQL_MAX_ROW from conf
formData: chartQueries[queryId].form_data,
datasource: mockDatasource[sliceEntities.slices[queryId].datasource],
sliceName: sliceEntities.slices[queryId].slice_name,
@@ -78,7 +78,7 @@ const defaultState = {
superset_can_explore: false,
superset_can_share: false,
superset_can_csv: false,
- common: { conf: { SUPERSET_WEBSERVER_TIMEOUT: 0 } },
+ common: { conf: { SUPERSET_WEBSERVER_TIMEOUT: 0, SQL_MAX_ROW: 666 } },
},
};