Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

396 - fix message logs #399

Merged
merged 5 commits into from
Mar 4, 2020
Merged
Changes from 1 commit
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
14 changes: 8 additions & 6 deletions lib/node/limits.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var estimates = require('../limits/estimates');

function limitNumberOfRows(node, context, limit, callback) {
if (!Number.isFinite(limit.value)) {
context.logError('Limit for number of rows is not defined');
context.logError({message: 'Limit for number of rows is not defined'});
return callback(null);
}
estimates.estimatedNumberOfRows(node, context, function(err, outputRows) {
Expand All @@ -26,7 +26,7 @@ function limitNumberOfRows(node, context, limit, callback) {

function limitInputRows(node, input, context, limit, callback) {
if (!Number.isFinite(limit.value)) {
context.logError('Limit for input rows is not defined');
context.logError({message: 'Limit for input rows is not defined'});
return callback(null);
}
estimates.estimatedNumberOfRows(node[input], context, function(err, numRows) {
Expand All @@ -48,10 +48,12 @@ function limitInputRowsAndAvgGroupedRows(node, input, categoriesData, context, l
var limitPresent = Number.isFinite(limit.value);
var groupedLimitPresent = Number.isFinite(groupedLimit.value);
if (!limitPresent && !groupedLimitPresent) {
context.logError('limitInputRowsAndAvgGroupedRows called without any passed limit');
context.logError({
message: 'limitInputRowsAndAvgGroupedRows called without any passed limit'
});
return callback(null);
} else if (groupedLimitPresent && !_verifyCategoryData(categoriesData)) {
context.logError('Categories data must contain source and column name keys');
context.logError({message: 'Categories data must contain source and column name keys'});
return callback(null);
}

Expand All @@ -73,10 +75,10 @@ function limitInputRowsAndAvgGroupedRows(node, input, categoriesData, context, l
function limitInputRowsMultipliedByCategories(node, input, categoryTarget, context, limit, callback) {
var limitPresent = Number.isFinite(limit.value);
if (!limitPresent) {
context.logError('Limit for input rows multiplied by categories is not defined');
context.logError({message: 'Limit for input rows multiplied by categories is not defined'});
return callback(null);
} else if (!_verifyCategoryData(categoryTarget)) {
context.logError('Categories data must contain source and column name keys');
context.logError({message: 'Categories data must contain source and column name keys'});
return callback(null);
}

Expand Down