Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
check limiting factor on query results (apache#14719)
Browse files Browse the repository at this point in the history
  • Loading branch information
eschutho authored and serenajiang committed May 21, 2021
1 parent 4160e45 commit 2624765
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 2624765

Please sign in to comment.