Skip to content

Commit

Permalink
Merge pull request getredash#2352 from kravets-levko/bug/query-result…
Browse files Browse the repository at this point in the history
…-column-names

Cast column names to string
  • Loading branch information
arikfr authored Feb 28, 2018
2 parents 2c95231 + 08c709c commit 6e097d5
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions client/app/services/query-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ function getColumnNameWithoutType(column) {
}

export function getColumnCleanName(column) {
const name = getColumnNameWithoutType(column);
return name;
return getColumnNameWithoutType(column);
}

function getColumnFriendlyName(column) {
Expand Down Expand Up @@ -120,6 +119,7 @@ function QueryResultService($resource, $timeout, $q) {
});

each(this.query_result.data.columns, (column) => {
column.name = '' + column.name;
if (columnTypes[column.name]) {
if (column.type == null || column.type === 'string') {
column.type = columnTypes[column.name];
Expand Down Expand Up @@ -183,9 +183,7 @@ function QueryResultService($resource, $timeout, $q) {
return null;
}

const data = this.query_result.data.rows;

return data;
return this.query_result.data.rows;
}

getData() {
Expand Down Expand Up @@ -262,12 +260,11 @@ function QueryResultService($resource, $timeout, $q) {
let sizeValue = null;

each(row, (v, definition) => {
const name = definition.split('::')[0] || definition.split('__')[0];
definition = '' + definition;
const definitionParts = definition.split('::') || definition.split('__');
const name = definitionParts[0];
const type = mapping ? mapping[definition] : definitionParts[1];
let value = v;
let type = definition.split('::')[1] || definition.split('__')[1];
if (mapping) {
type = mapping[definition];
}

if (type === 'unused') {
return;
Expand Down

0 comments on commit 6e097d5

Please sign in to comment.