diff --git a/lib/cartodb/models/dataview/aggregation.js b/lib/cartodb/models/dataview/aggregation.js index f621e536..7f6c198a 100644 --- a/lib/cartodb/models/dataview/aggregation.js +++ b/lib/cartodb/models/dataview/aggregation.js @@ -236,7 +236,7 @@ module.exports = class Aggregation extends BaseDataview { override = {}; } - if (this.aggregationColumn && this._isFloatColumn === null) { + if (this._shouldCheckColumnType()) { this._isFloatColumn = false; this.getColumnType(psql, this.aggregationColumn, this.queries.no_filters, function (err, type) { if (!err && !!type) { @@ -266,6 +266,10 @@ module.exports = class Aggregation extends BaseDataview { return callback(null, aggregationSql); } + _shouldCheckColumnType () { + return this.aggregationColumn && this._isFloatColumn === null; + } + format (result) { const { count = 0,