Skip to content

Commit

Permalink
check limiting factor on query results (#14719)
Browse files Browse the repository at this point in the history
  • Loading branch information
eschutho committed May 19, 2021
1 parent 26c0b30 commit a9d888a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions superset-frontend/src/SqlLab/components/ResultSet.tsx
Expand Up @@ -527,6 +527,7 @@ export default class ResultSet extends React.PureComponent<
let limitMessage;
const limitReached = results?.displayLimitReached;
const isAdmin = !!this.props.user?.roles.Admin;
const limit = queryLimit || results.query.limit;
const displayMaxRowsReachedMessage = {
withAdmin: t(
`The number of results displayed is limited to %(rows)d by the configuration DISPLAY_MAX_ROWS. `,
Expand All @@ -535,7 +536,9 @@ export default class ResultSet extends React.PureComponent<
t(
`Please add additional limits/filters or download to csv to see more rows up to the`,
),
t(`the %(queryLimit)d limit.`, { queryLimit }),
t(`the %(limit)d limit.`, {
limit,
}),
),
withoutAdmin: t(
`The number of results displayed is limited to %(rows)d. `,
Expand All @@ -544,8 +547,8 @@ export default class ResultSet extends React.PureComponent<
t(
`Please add additional limits/filters, download to csv, or contact an admin`,
),
t(`to see more rows up to the the %(queryLimit)d limit.`, {
queryLimit,
t(`to see more rows up to the the %(limit)d limit.`, {
limit,
}),
),
};
Expand Down
1 change: 1 addition & 0 deletions superset-frontend/src/SqlLab/types.ts
Expand Up @@ -52,6 +52,7 @@ export type Query = {
data: Record<string, unknown>[];
expanded_columns: Column[];
selected_columns: Column[];
query: { limit: number };
};
resultsKey: string | null;
schema: string;
Expand Down

0 comments on commit a9d888a

Please sign in to comment.