diff --git a/extensions/jython/src/com/google/refine/jython/JythonEvaluable.java b/extensions/jython/src/com/google/refine/jython/JythonEvaluable.java index 0c9c73481..b860a7327 100644 --- a/extensions/jython/src/com/google/refine/jython/JythonEvaluable.java +++ b/extensions/jython/src/com/google/refine/jython/JythonEvaluable.java @@ -41,7 +41,10 @@ import java.util.Properties; import org.python.core.Py; import org.python.core.PyException; +import org.python.core.PyFloat; import org.python.core.PyFunction; +import org.python.core.PyInteger; +import org.python.core.PyLong; import org.python.core.PyNone; import org.python.core.PyObject; import org.python.core.PyString; @@ -137,6 +140,12 @@ public class JythonEvaluable implements Evaluable { return ((JythonHasFieldsWrapper) result)._obj; } else if (result instanceof PyString) { return ((PyString) result).asString(); + } else if (result instanceof PyInteger) { + return (long) ((PyInteger) result).asInt(); + } else if (result instanceof PyLong) { + return ((PyLong) result).getLong(Long.MIN_VALUE, Long.MAX_VALUE); + } else if (result instanceof PyFloat) { + return ((PyFloat) result).asDouble(); } else if (result instanceof PyObject) { return unwrap((PyObject) result); } diff --git a/main/src/com/google/refine/browsing/util/ExpressionNominalValueGrouper.java b/main/src/com/google/refine/browsing/util/ExpressionNominalValueGrouper.java index 041d2086f..4cec02feb 100644 --- a/main/src/com/google/refine/browsing/util/ExpressionNominalValueGrouper.java +++ b/main/src/com/google/refine/browsing/util/ExpressionNominalValueGrouper.java @@ -183,7 +183,7 @@ public class ExpressionNominalValueGrouper implements RowVisitor, RecordVisitor facetChoice.count++; } } else { - String label = value.toString(); + String label = valueString; DecoratedValue dValue = new DecoratedValue(value, label); IndexedNominalFacetChoice choice = new IndexedNominalFacetChoice(dValue, index); diff --git a/main/webapp/modules/core/scripts/views/data-table/cell-ui.js b/main/webapp/modules/core/scripts/views/data-table/cell-ui.js index 5d25c38ee..15015ea37 100644 --- a/main/webapp/modules/core/scripts/views/data-table/cell-ui.js +++ b/main/webapp/modules/core/scripts/views/data-table/cell-ui.js @@ -64,7 +64,7 @@ DataTableCellUI.prototype._render = function() { } else if ("e" in cell) { $('').addClass("data-table-error").text(cell.e).appendTo(divContent); } else if (!("r" in cell) || !cell.r) { - if (typeof cell.v !== "string") { + if (typeof cell.v !== "string" || "t" in cell) { if (typeof cell.v == "number") { divContent.addClass("data-table-cell-content-numeric"); }