PyCode py = repo.getTransformCode();
int numRowsWithErrors = 0;
for (Node node : nodes) {
Row row = node.getBelongsToRow();
interpreter.set("nodeid", node.getId());
try {
PyObject output = interpreter.eval(py);
String transformedValue = PythonTransformationHelper
.getPyObjectValueAsString(output);
addTransformedValue(transformedRows, row, transformedValue);
} catch (PyException p) {
logger.info("error in evaluation python, skipping one row");
numRowsWithErrors++;
// Error occured in the Python method execution
addTransformedValue(transformedRows, row, errorDefaultValue);
addError(errorValues, row, counter, p.value);
} catch (Exception t) {
// Error occured in the Python method execution
logger.debug(
"Error occured while transforming, using default value.",
t);
numRowsWithErrors++;
rowToValueMap.put(row.getId(), errorDefaultValue);
}
if (limit != null && ++counter >= limit) {
break;
}
}