Automatically lint fixes
This commit is contained in:
parent
97f4adbc1a
commit
7b13c12ab4
@ -85,9 +85,9 @@ module.exports = class ApiRouter {
|
|||||||
const metadataBackend = cartodbRedis({ pool: redisPool });
|
const metadataBackend = cartodbRedis({ pool: redisPool });
|
||||||
const pgConnection = new PgConnection(metadataBackend);
|
const pgConnection = new PgConnection(metadataBackend);
|
||||||
|
|
||||||
const windshaftLogger = environmentOptions.log_windshaft && global.log4js ?
|
const windshaftLogger = environmentOptions.log_windshaft && global.log4js
|
||||||
global.log4js.getLogger('[windshaft]') :
|
? global.log4js.getLogger('[windshaft]')
|
||||||
null;
|
: null;
|
||||||
const mapStore = new windshaft.storage.MapStore({
|
const mapStore = new windshaft.storage.MapStore({
|
||||||
pool: redisPool,
|
pool: redisPool,
|
||||||
expire_time: serverOptions.grainstore.default_layergroup_ttl,
|
expire_time: serverOptions.grainstore.default_layergroup_ttl,
|
||||||
|
@ -241,7 +241,7 @@ Aggregation.prototype._checkOptions = function (options) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Aggregation.prototype.getAggregationSql = function() {
|
Aggregation.prototype.getAggregationSql = function () {
|
||||||
return aggregationFnQueryTpl[this.aggregation]({
|
return aggregationFnQueryTpl[this.aggregation]({
|
||||||
_aggregationFn: this.aggregation,
|
_aggregationFn: this.aggregation,
|
||||||
_aggregationColumn: this.aggregationColumn || 1
|
_aggregationColumn: this.aggregationColumn || 1
|
||||||
|
@ -90,10 +90,10 @@ MapConfigNamedLayersAdapter.prototype.getMapConfig = function (user, requestMapC
|
|||||||
if (layersResult.datasource) {
|
if (layersResult.datasource) {
|
||||||
datasourceBuilder.withLayerDatasource(currentLayerIndex, {
|
datasourceBuilder.withLayerDatasource(currentLayerIndex, {
|
||||||
user: dbAuth.dbuser,
|
user: dbAuth.dbuser,
|
||||||
// Used internally (PSQL)
|
// Used internally (PSQL)
|
||||||
pass: dbAuth.dbpassword,
|
pass: dbAuth.dbpassword,
|
||||||
dbpassword: dbAuth.dbpassword,
|
dbpassword: dbAuth.dbpassword,
|
||||||
// Used by Mapnik
|
// Used by Mapnik
|
||||||
password: dbAuth.dbpassword
|
password: dbAuth.dbpassword
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ module.exports.getQueryActualRowCount = function (query) {
|
|||||||
return `select COUNT(*) AS rows FROM (${substituteDummyTokens(query)}) AS __cdb_query`;
|
return `select COUNT(*) AS rows FROM (${substituteDummyTokens(query)}) AS __cdb_query`;
|
||||||
};
|
};
|
||||||
|
|
||||||
function getQueryRowEstimation(query) {
|
function getQueryRowEstimation (query) {
|
||||||
return 'select cartodb.CDB_EstimateRowCount($windshaft$' + substituteDummyTokens(query) + '$windshaft$) as rows';
|
return 'select cartodb.CDB_EstimateRowCount($windshaft$' + substituteDummyTokens(query) + '$windshaft$) as rows';
|
||||||
}
|
}
|
||||||
module.exports.getQueryRowEstimation = getQueryRowEstimation;
|
module.exports.getQueryRowEstimation = getQueryRowEstimation;
|
||||||
|
@ -658,7 +658,7 @@ describe('dataviews using tables with overviews', function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('agreggation validation', function (){
|
describe('agreggation validation', function () {
|
||||||
const params = {
|
const params = {
|
||||||
response: {
|
response: {
|
||||||
status: 400,
|
status: 400,
|
||||||
@ -668,21 +668,22 @@ describe('dataviews using tables with overviews', function () {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function createMapConfig(options) {
|
function createMapConfig (options) {
|
||||||
return {
|
return {
|
||||||
version: '1.8.0',
|
version: '1.8.0',
|
||||||
analyses: [
|
analyses: [
|
||||||
{ id: 'data-source',
|
{
|
||||||
|
id: 'data-source',
|
||||||
type: 'source',
|
type: 'source',
|
||||||
params: {
|
params: {
|
||||||
query: 'select * from test_table_overviews'
|
query: 'select * from test_table_overviews'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
dataviews: {
|
dataviews: {
|
||||||
test_invalid_aggregation: {
|
test_invalid_aggregation: {
|
||||||
type: 'aggregation',
|
type: 'aggregation',
|
||||||
source: {id: 'data-source'},
|
source: { id: 'data-source' },
|
||||||
options: options
|
options: options
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -702,8 +703,8 @@ describe('dataviews using tables with overviews', function () {
|
|||||||
|
|
||||||
it('should fail if missing column', function (done) {
|
it('should fail if missing column', function (done) {
|
||||||
var options = {
|
var options = {
|
||||||
aggregation: "sum",
|
aggregation: 'sum',
|
||||||
aggregationColumn: "value"
|
aggregationColumn: 'value'
|
||||||
};
|
};
|
||||||
var missingColumnMapConfig = createMapConfig(options);
|
var missingColumnMapConfig = createMapConfig(options);
|
||||||
|
|
||||||
@ -727,8 +728,8 @@ describe('dataviews using tables with overviews', function () {
|
|||||||
|
|
||||||
it('should fail if no aggregation operation', function (done) {
|
it('should fail if no aggregation operation', function (done) {
|
||||||
var options = {
|
var options = {
|
||||||
column: "value",
|
column: 'value',
|
||||||
aggregationColumn: "value"
|
aggregationColumn: 'value'
|
||||||
};
|
};
|
||||||
var missingOperationMapConfig = createMapConfig(options);
|
var missingOperationMapConfig = createMapConfig(options);
|
||||||
|
|
||||||
@ -752,9 +753,9 @@ describe('dataviews using tables with overviews', function () {
|
|||||||
|
|
||||||
it('should fail if fake operation', function (done) {
|
it('should fail if fake operation', function (done) {
|
||||||
var options = {
|
var options = {
|
||||||
column: "value",
|
column: 'value',
|
||||||
aggregation: "wadus",
|
aggregation: 'wadus',
|
||||||
aggregationColumn: "value"
|
aggregationColumn: 'value'
|
||||||
};
|
};
|
||||||
var wrongOperationMapConfig = createMapConfig(options);
|
var wrongOperationMapConfig = createMapConfig(options);
|
||||||
|
|
||||||
@ -778,9 +779,9 @@ describe('dataviews using tables with overviews', function () {
|
|||||||
|
|
||||||
it('should fail if invalid operation for overview', function (done) {
|
it('should fail if invalid operation for overview', function (done) {
|
||||||
var options = {
|
var options = {
|
||||||
column: "value",
|
column: 'value',
|
||||||
aggregation: "avg",
|
aggregation: 'avg',
|
||||||
aggregationColumn: "value"
|
aggregationColumn: 'value'
|
||||||
};
|
};
|
||||||
var wrongOperationMapConfig = createMapConfig(options);
|
var wrongOperationMapConfig = createMapConfig(options);
|
||||||
|
|
||||||
@ -804,8 +805,8 @@ describe('dataviews using tables with overviews', function () {
|
|||||||
|
|
||||||
it('should fail if no aggregation column when needed', function (done) {
|
it('should fail if no aggregation column when needed', function (done) {
|
||||||
var options = {
|
var options = {
|
||||||
column: "value",
|
column: 'value',
|
||||||
aggregation: "sum"
|
aggregation: 'sum'
|
||||||
};
|
};
|
||||||
var missingOptionMapConfig = createMapConfig(options);
|
var missingOptionMapConfig = createMapConfig(options);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user