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

rusackas 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 15d7538435c fix(sqllab): pass queryLimit on data preview queries and 
fix Decimal TypeError in results handler (#37614)
15d7538435c is described below

commit 15d7538435cd4d1196775a4ed10d5cf02c8f7ef5
Author: Andy <[email protected]>
AuthorDate: Fri Feb 27 18:35:44 2026 -0500

    fix(sqllab): pass queryLimit on data preview queries and fix Decimal 
TypeError in results handler (#37614)
    
    Co-authored-by: Claude Opus 4.5 <[email protected]>
---
 superset-frontend/src/SqlLab/actions/sqlLab.ts                 | 2 ++
 superset-frontend/src/SqlLab/components/TablePreview/index.tsx | 2 +-
 superset-frontend/src/SqlLab/constants.ts                      | 2 ++
 superset/commands/sql_lab/results.py                           | 2 +-
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.ts 
b/superset-frontend/src/SqlLab/actions/sqlLab.ts
index 3fe01a03071..7d8da1f87cd 100644
--- a/superset-frontend/src/SqlLab/actions/sqlLab.ts
+++ b/superset-frontend/src/SqlLab/actions/sqlLab.ts
@@ -46,6 +46,7 @@ import type { QueryEditor, SqlLabRootState, Table } from 
'../types';
 import { newQueryTabName } from '../utils/newQueryTabName';
 import getInitialState from '../reducers/getInitialState';
 import { rehydratePersistedState } from 
'../utils/reduxStateToLocalStorageHelper';
+import { PREVIEW_QUERY_LIMIT } from '../constants';
 
 // Type definitions for SqlLab actions
 export interface Query {
@@ -1317,6 +1318,7 @@ export function runTablePreviewQuery(
         runAsync: database.allow_run_async,
         ctas: false,
         isDataPreview: true,
+        queryLimit: PREVIEW_QUERY_LIMIT,
       };
       if (runPreviewOnly) {
         return dispatch(runQuery(dataPreviewQuery, runPreviewOnly));
diff --git a/superset-frontend/src/SqlLab/components/TablePreview/index.tsx 
b/superset-frontend/src/SqlLab/components/TablePreview/index.tsx
index ecf8318fd7f..e69fad4473b 100644
--- a/superset-frontend/src/SqlLab/components/TablePreview/index.tsx
+++ b/superset-frontend/src/SqlLab/components/TablePreview/index.tsx
@@ -41,6 +41,7 @@ import {
   useTableMetadataQuery,
 } from 'src/hooks/apiResources';
 import { runTablePreviewQuery } from 'src/SqlLab/actions/sqlLab';
+import { PREVIEW_QUERY_LIMIT } from 'src/SqlLab/constants';
 import { ActionButton } from '@superset-ui/core/components/ActionButton';
 import ResultSet from '../ResultSet';
 import ShowSQL from '../ShowSQL';
@@ -63,7 +64,6 @@ const TABS_KEYS = {
   SAMPLE: 'sample',
 };
 const TAB_HEADER_HEIGHT = 80;
-const PREVIEW_QUERY_LIMIT = 100;
 
 const Title = styled.div`
   ${({ theme }) => css`
diff --git a/superset-frontend/src/SqlLab/constants.ts 
b/superset-frontend/src/SqlLab/constants.ts
index 6f81f8287ac..1f8753453cb 100644
--- a/superset-frontend/src/SqlLab/constants.ts
+++ b/superset-frontend/src/SqlLab/constants.ts
@@ -87,6 +87,8 @@ export const LOCALSTORAGE_MAX_QUERY_RESULTS_KB = 1 * 1024; // 
1M
 export const LOCALSTORAGE_WARNING_THRESHOLD = 0.9;
 export const LOCALSTORAGE_WARNING_MESSAGE_THROTTLE_MS = 8000; // danger type 
toast duration
 
+export const PREVIEW_QUERY_LIMIT = 100;
+
 // autocomplete score weights
 export const SQL_KEYWORD_AUTOCOMPLETE_SCORE = 100;
 export const SQL_FUNCTIONS_AUTOCOMPLETE_SCORE = 90;
diff --git a/superset/commands/sql_lab/results.py 
b/superset/commands/sql_lab/results.py
index 0ba5100cada..a3cff3bf1ea 100644
--- a/superset/commands/sql_lab/results.py
+++ b/superset/commands/sql_lab/results.py
@@ -94,7 +94,7 @@ class SqlExecutionResultsCommand(BaseCommand):
         if not self._blob:
             # Query exists in DB but results not in S3 - enhanced diagnostics
             query_age_seconds = now_as_float() - (
-                self._query.end_time if self._query.end_time else 
now_as_float()
+                float(self._query.end_time) if self._query.end_time else 
now_as_float()
             )
             logger.warning(
                 "410 Error - Query exists in DB but results not in results 
backend"

Reply via email to