From 1e14a0934ec2c3670fd6f6d53446d8c65231c9a5 Mon Sep 17 00:00:00 2001 From: James Dunkerley Date: Sat, 8 Jun 2024 12:43:17 +0100 Subject: [PATCH] Java format and aggregate tests. --- .../callable/UnresolvedConstructor.java | 1 - .../Aggregate_Spec.enso | 24 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/engine/runtime/src/main/java/org/enso/interpreter/runtime/callable/UnresolvedConstructor.java b/engine/runtime/src/main/java/org/enso/interpreter/runtime/callable/UnresolvedConstructor.java index eb1429e355255..e643b64c78284 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/runtime/callable/UnresolvedConstructor.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/runtime/callable/UnresolvedConstructor.java @@ -16,7 +16,6 @@ import java.util.Objects; import java.util.UUID; import org.enso.compiler.context.LocalScope; -import org.enso.compiler.core.ir.module.scope.Definition; import org.enso.interpreter.EnsoLanguage; import org.enso.interpreter.node.ClosureRootNode; import org.enso.interpreter.node.EnsoRootNode; diff --git a/test/Table_Tests/src/Common_Table_Operations/Aggregate_Spec.enso b/test/Table_Tests/src/Common_Table_Operations/Aggregate_Spec.enso index a27b41bbbd019..2a1e3d8ac3e20 100644 --- a/test/Table_Tests/src/Common_Table_Operations/Aggregate_Spec.enso +++ b/test/Table_Tests/src/Common_Table_Operations/Aggregate_Spec.enso @@ -73,6 +73,15 @@ add_specs suite_builder setup = materialized.columns.at 0 . name . should_equal "Count" materialized.columns.at 0 . at 0 . should_equal 2500 + group_builder.specify "should be able to count (autoscoped)" <| + grouped = data.table.aggregate columns=[..Count] + materialized = materialize grouped + Problems.assume_no_problems materialized + grouped.row_count . should_equal 1 + materialized.column_count . should_equal 1 + materialized.columns.at 0 . name . should_equal "Count" + materialized.columns.at 0 . at 0 . should_equal 2500 + group_builder.specify "should be able to count missing values" <| grouped = data.table.aggregate columns=[Count_Nothing "Hexadecimal", Count_Not_Nothing "Hexadecimal", Count_Empty "TextWithNothing", Count_Not_Empty "TextWithNothing"] materialized = materialize grouped @@ -125,6 +134,21 @@ add_specs suite_builder setup = materialized.columns.at 3 . name . should_equal "Average ValueWithNothing" materialized.columns.at 3 . at 0 . should_equal 1.228650 epsilon=0.000001 + group_builder.specify "should be able to compute sum and average of values (autoscoped)" <| + grouped = data.table.aggregate columns=[..Sum "Value", ..Sum "ValueWithNothing", ..Average "Value", ..Average "ValueWithNothing"] + materialized = materialize grouped + Problems.assume_no_problems materialized + grouped.row_count . should_equal 1 + materialized.column_count . should_equal 4 + materialized.columns.at 0 . name . should_equal "Sum Value" + materialized.columns.at 0 . at 0 . should_equal -932.411550 epsilon=0.000001 + materialized.columns.at 1 . name . should_equal "Sum ValueWithNothing" + materialized.columns.at 1 . at 0 . should_equal 2757.09 epsilon=0.000001 + materialized.columns.at 2 . name . should_equal "Average Value" + materialized.columns.at 2 . at 0 . should_equal -0.372965 epsilon=0.000001 + materialized.columns.at 3 . name . should_equal "Average ValueWithNothing" + materialized.columns.at 3 . at 0 . should_equal 1.228650 epsilon=0.000001 + group_builder.specify "should be able to compute standard deviation of values" (pending = resolve_pending test_selection.std_dev) <| grouped = data.table.aggregate columns=[Standard_Deviation "Value", Standard_Deviation "ValueWithNothing", (Standard_Deviation "Value" population=True), (Standard_Deviation "ValueWithNothing" population=True)] materialized = materialize grouped