Skip to content

Commit

Permalink
trim logic
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdotson committed Nov 12, 2021
1 parent 91fc290 commit e7ea74a
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions superset-frontend/src/explore/components/DataTablesPane/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,22 +253,10 @@ export const DataTablesPane = ({
const checkCols = json?.result[0]?.data?.length
? Object.keys(json.result[0].data[0])
: null;
if (!json.result[0].colnames && checkCols?.length) {
let tabKey: string = RESULT_TYPES.results;
if (resultType === RESULT_TYPES.samples) {
tabKey = RESULT_TYPES.samples;
}
setColumnNames({
...columnNames,
[tabKey]: checkCols,
});
}
if (json.result[0].colnames) {
setColumnNames({
...columnNames,
[resultType]: json.result[0].colnames,
});
}
setColumnNames(prevColumnNames => ({
...prevColumnNames,
[resultType]: json.result[0].columns || checkCols,
}));
setIsLoading(prevIsLoading => ({
...prevIsLoading,
[resultType]: false,
Expand Down

0 comments on commit e7ea74a

Please sign in to comment.