Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

fix: unset row_limit when it's not a number #387

Merged
merged 2 commits into from
Apr 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/superset-ui-query/src/buildQueryObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default function buildQueryObject<T extends QueryFormData>(formData: T):
} = formData;

const groupbySet = new Set([...columns, ...groupby]);
const numericRowLimit = Number(row_limit);

const queryObject: QueryObject = {
extras: processExtras(formData),
Expand All @@ -42,7 +43,7 @@ export default function buildQueryObject<T extends QueryFormData>(formData: T):
metrics: processMetrics(formData),
order_desc: typeof order_desc === 'undefined' ? true : order_desc,
orderby: [],
row_limit: Number(row_limit),
row_limit: row_limit == null || isNaN(numericRowLimit) ? undefined : numericRowLimit,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use Number.isNaN, instead of isNaN 

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

since,
time_range,
timeseries_limit: limit ? Number(limit) : 0,
Expand Down