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 2024/01/26 13:57:28 UTC

(superset) branch master updated: fix: Row limit hardcoded (#26807)

This is an automated email from the ASF dual-hosted git repository.

michaelsmolina 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 5e633d2bb0 fix: Row limit hardcoded (#26807)
5e633d2bb0 is described below

commit 5e633d2bb0909f1cb4904c07e29a2c683f02131c
Author: Michael S. Molina <70...@users.noreply.github.com>
AuthorDate: Fri Jan 26 08:57:21 2024 -0500

    fix: Row limit hardcoded (#26807)
---
 .../superset-ui-chart-controls/src/shared-controls/sharedControls.tsx | 4 ++--
 tests/integration_tests/celery_tests.py                               | 2 +-
 tests/integration_tests/superset_test_config.py                       | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx
index 9c1837ad87..aec23e8ddb 100644
--- a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx
+++ b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx
@@ -243,10 +243,10 @@ const row_limit: SharedControlConfig<'SelectControl'> = {
   freeForm: true,
   label: t('Row limit'),
   clearable: false,
+  mapStateToProps: state => ({ maxValue: state?.common?.conf?.SQL_MAX_ROW }),
   validators: [
     legacyValidateInteger,
-    (v, state) =>
-      validateMaxValue(v, state?.common?.conf?.SQL_MAX_ROW || DEFAULT_MAX_ROW),
+    (v, state) => validateMaxValue(v, state?.maxValue || DEFAULT_MAX_ROW),
   ],
   default: 10000,
   choices: formatSelectOptions(ROW_LIMIT_OPTIONS),
diff --git a/tests/integration_tests/celery_tests.py b/tests/integration_tests/celery_tests.py
index 29a1f7a66a..b0ac6ac6c7 100644
--- a/tests/integration_tests/celery_tests.py
+++ b/tests/integration_tests/celery_tests.py
@@ -344,7 +344,7 @@ def test_run_async_cta_query_with_lower_limit(test_client, ctas_method):
     assert QUERY == query.sql
 
     assert query.rows == (1 if backend() == "presto" else 0)
-    assert query.limit == 10000
+    assert query.limit == 50000
     assert query.select_as_cta
     assert query.select_as_cta_used
 
diff --git a/tests/integration_tests/superset_test_config.py b/tests/integration_tests/superset_test_config.py
index 31d57b06e0..62e0985638 100644
--- a/tests/integration_tests/superset_test_config.py
+++ b/tests/integration_tests/superset_test_config.py
@@ -61,7 +61,7 @@ if "sqlite" in SQLALCHEMY_DATABASE_URI:
 PRESTO_POLL_INTERVAL = 0.1
 HIVE_POLL_INTERVAL = 0.1
 
-SQL_MAX_ROW = 10000
+SQL_MAX_ROW = 50000
 SQLLAB_CTAS_NO_LIMIT = True  # SQL_MAX_ROW will not take effect for the CTA queries
 FEATURE_FLAGS = {
     **FEATURE_FLAGS,