From 91399b13917ef233ab60ca1b4e3e5f8f4a53baf0 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Fri, 26 Jan 2024 08:57:21 -0500 Subject: [PATCH] fix: Row limit hardcoded (#26807) (cherry picked from commit 5e633d2bb0909f1cb4904c07e29a2c683f02131c) --- .../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 4396f4f2e9495..56f3bc246e421 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 @@ -245,10 +245,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 29a1f7a66afa0..b0ac6ac6c7ed4 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 89287be663e55..60b2d1107e508 100644 --- a/tests/integration_tests/superset_test_config.py +++ b/tests/integration_tests/superset_test_config.py @@ -60,7 +60,7 @@ 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,