mirror of
https://github.com/apache/superset.git
synced 2026-04-07 18:35:15 +00:00
fix(sqllab): pass queryLimit on data preview queries and fix Decimal TypeError in results handler (#37614)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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`
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user