From cfb2f2916eb1d81f521c5af238e42c2b227f65d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Wa=C5=9Bko?= Date: Fri, 2 Jun 2023 14:09:20 +0200 Subject: [PATCH] Merge `Column_Indexes_Out_Of_Range` into `Missing_Input_Columns`. (#6901) Implements #6869 --- .../Database/0.0.0-dev/src/Data/Table.enso | 48 ++++--------------- .../Table/0.0.0-dev/src/Data/Table.enso | 48 ++++--------------- .../Standard/Table/0.0.0-dev/src/Errors.enso | 26 ++++------ .../0.0.0-dev/src/Internal/Join_Helpers.enso | 6 +-- .../src/Internal/Problem_Builder.enso | 17 +++---- .../Add_Row_Number_Spec.enso | 4 +- .../Aggregate_Spec.enso | 18 +++---- .../Cross_Tab_Spec.enso | 12 ++--- .../Distinct_Spec.enso | 6 +-- .../Join/Join_Spec.enso | 22 ++++----- .../Order_By_Spec.enso | 4 +- .../Select_Columns_Spec.enso | 24 ++++------ .../Transpose_Spec.enso | 6 +-- .../src/Formatting/Parse_Values_Spec.enso | 9 ++-- 14 files changed, 84 insertions(+), 166 deletions(-) diff --git a/distribution/lib/Standard/Database/0.0.0-dev/src/Data/Table.enso b/distribution/lib/Standard/Database/0.0.0-dev/src/Data/Table.enso index 720ebb587dca..7f466d3ae556 100644 --- a/distribution/lib/Standard/Database/0.0.0-dev/src/Data/Table.enso +++ b/distribution/lib/Standard/Database/0.0.0-dev/src/Data/Table.enso @@ -166,10 +166,6 @@ type Table `Missing_Input_Columns` is raised as an error, unless `error_on_missing_columns` is set to `False`, in which case the problem is reported according to the `on_problems` setting. - - If a column index is out of range, a `Column_Indexes_Out_Of_Range` is - raised as an error, unless `error_on_missing_columns` is set to - `False`, in which case the problem is reported according to the - `on_problems` setting. > Example Select columns by name. @@ -192,7 +188,7 @@ type Table Icon: select_column @columns Widget_Helpers.make_column_name_vector_selector - select_columns : Vector (Integer | Text | Column_Selector) | Text | Integer -> Boolean -> Boolean -> Problem_Behavior -> Table ! No_Output_Columns | Missing_Input_Columns | Column_Indexes_Out_Of_Range + select_columns : Vector (Integer | Text | Column_Selector) | Text | Integer -> Boolean -> Boolean -> Problem_Behavior -> Table ! No_Output_Columns | Missing_Input_Columns select_columns self (columns = [self.columns.first.name]) (reorder = False) (error_on_missing_columns = True) (on_problems = Report_Warning) = new_columns = self.columns_helper.select_columns selectors=columns reorder=reorder error_on_missing_columns=error_on_missing_columns on_problems=on_problems self.updated_columns new_columns @@ -221,10 +217,6 @@ type Table `Missing_Input_Columns` is reported according to the `on_problems` setting, unless `error_on_missing_columns` is set to `True`, in which case it is raised as an error. - - If a column index is out of range, a `Column_Indexes_Out_Of_Range` is - reported according to the `on_problems` setting, unless - `error_on_missing_columns` is set to `True`, in which case it is - raised as an error. > Example Remove columns with given names. @@ -246,7 +238,7 @@ type Table table.remove_columns [-1, 0, 1] @columns Widget_Helpers.make_column_name_vector_selector - remove_columns : Vector (Integer | Text | Column_Selector) | Text | Integer -> Boolean -> Problem_Behavior -> Table ! No_Output_Columns | Missing_Input_Columns | Column_Indexes_Out_Of_Range + remove_columns : Vector (Integer | Text | Column_Selector) | Text | Integer -> Boolean -> Problem_Behavior -> Table ! No_Output_Columns | Missing_Input_Columns remove_columns self (columns = [self.columns.first.name]) (error_on_missing_columns = False) (on_problems = Report_Warning) = new_columns = self.columns_helper.remove_columns selectors=columns error_on_missing_columns=error_on_missing_columns on_problems=on_problems self.updated_columns new_columns @@ -272,10 +264,6 @@ type Table `Missing_Input_Columns` is reported according to the `on_problems` setting, unless `error_on_missing_columns` is set to `True`, in which case it is raised as an error. - - If a column index is out of range, a `Column_Indexes_Out_Of_Range` is - reported according to the `on_problems` setting, unless - `error_on_missing_columns` is set to `True`, in which case it is - raised as an error. > Example Move a column with a specified name to back. @@ -302,7 +290,7 @@ type Table table.reorder_columns [0] position=Position.After_Other_Columns @columns Widget_Helpers.make_column_name_vector_selector - reorder_columns : Vector (Integer | Text | Column_Selector) | Text | Integer -> Position -> Boolean -> Problem_Behavior -> Table ! Missing_Input_Columns | Column_Indexes_Out_Of_Range + reorder_columns : Vector (Integer | Text | Column_Selector) | Text | Integer -> Position -> Boolean -> Problem_Behavior -> Table ! Missing_Input_Columns reorder_columns self (columns = [self.columns.first.name]) (position = Position.Before_Other_Columns) (error_on_missing_columns = False) (on_problems = Report_Warning) = new_columns = self.columns_helper.reorder_columns selectors=columns position=position error_on_missing_columns on_problems=on_problems self.updated_columns new_columns @@ -352,10 +340,6 @@ type Table `Missing_Input_Columns` is raised as an error, unless `error_on_missing_columns` is set to `False`, in which case the problem is reported according to the `on_problems` setting. - - If a column index is out of range, a `Column_Indexes_Out_Of_Range` is - raised as an error, unless `error_on_missing_columns` is set to - `False`, in which case the problem is reported according to the - `on_problems` setting. - Other problems are reported according to the `on_problems` setting: - If a column is matched by two selectors resulting in a different name mapping, a `Ambiguous_Column_Rename`. @@ -397,7 +381,7 @@ type Table by_name = Column_Selector.By_Name "name=(.*)" Case_Sensitivity.Sensitive use_regex=True table.rename_columns (Map.from_vector [[by_name, "key:$1"]]) @column_map Widget_Helpers.make_rename_name_vector_selector - rename_columns : Map (Text | Integer | Column_Selector) Text | Vector Text | Vector Vector -> Boolean -> Problem_Behavior -> Table ! Missing_Input_Columns | Column_Indexes_Out_Of_Range | Ambiguous_Column_Rename | Too_Many_Column_Names_Provided | Invalid_Output_Column_Names | Duplicate_Output_Column_Names + rename_columns : Map (Text | Integer | Column_Selector) Text | Vector Text | Vector Vector -> Boolean -> Problem_Behavior -> Table ! Missing_Input_Columns | Ambiguous_Column_Rename | Too_Many_Column_Names_Provided | Invalid_Output_Column_Names | Duplicate_Output_Column_Names rename_columns self column_map=["Column"] (error_on_missing_columns=True) (on_problems=Report_Warning) = new_names = Table_Helpers.rename_columns internal_columns=self.internal_columns mapping=column_map error_on_missing_columns=error_on_missing_columns on_problems=on_problems Warning.with_suspended new_names names-> @@ -570,8 +554,7 @@ type Table ! Error Conditions - If the columns specified in `group_by` or `order_by` are not present - in the table, a `Missing_Input_Columns` or - `Column_Indexes_Out_Of_Range` error is raised. + in the table, a `Missing_Input_Columns` error is raised. - If the column with the same name as provided `name` already exists, a `Duplicate_Output_Column_Names` problem is reported and the existing column is renamed to avoid the clash. @@ -798,10 +781,6 @@ type Table `Missing_Input_Columns` is raised as an error, unless `error_on_missing_columns` is set to `False`, in which case the problem is reported according to the `on_problems` setting. - - If a column index is out of range, a `Column_Indexes_Out_Of_Range` is - raised as an error, unless `error_on_missing_columns` is set to - `False`, in which case the problem is reported according to the - `on_problems` setting. - If no columns have been selected for ordering, a `No_Input_Columns_Selected` is raised as dataflow error regardless of any settings. @@ -847,7 +826,7 @@ type Table table.order_by [(Sort_Column.Select_By_Name "a.*" use_regex=True case_sensitivity=Case_Sensitivity.Insensitive)] @columns Widget_Helpers.make_order_by_selector - order_by : Vector (Text | Sort_Column) | Text -> Text_Ordering -> Boolean -> Problem_Behavior -> Table ! Incomparable_Values | No_Input_Columns_Selected | Missing_Input_Columns | Column_Indexes_Out_Of_Range + order_by : Vector (Text | Sort_Column) | Text -> Text_Ordering -> Boolean -> Problem_Behavior -> Table ! Incomparable_Values | No_Input_Columns_Selected | Missing_Input_Columns order_by self (columns = ([(Sort_Column.Name (self.columns.at 0 . name))])) text_ordering=Text_Ordering.Default error_on_missing_columns=True on_problems=Problem_Behavior.Report_Warning = Panic.handle_wrapped_dataflow_error <| problem_builder = Problem_Builder.new error_on_missing_columns=error_on_missing_columns types_to_always_throw=[No_Input_Columns_Selected] columns_for_ordering = Table_Helpers.prepare_order_by self.columns columns problem_builder @@ -1282,7 +1261,7 @@ type Table not possible to create a table without any columns. - If a given aggregate is not supported by the backend, `Unsupported_Database_Operation` is reported. - - If a column index is out of range, a `Column_Indexes_Out_Of_Range` is + - If a column index is out of range, a `Missing_Input_Columns` is reported according to the `on_problems` setting, unless `error_on_missing_columns` is set to `True`, in which case it is raised as an error. Problems resolving `Group_By` columns are @@ -1391,15 +1370,11 @@ type Table `Missing_Input_Columns` is raised as an error, unless `error_on_missing_columns` is set to `False`, in which case the problem is reported according to the `on_problems` setting. - - If a column index is out of range, a `Column_Indexes_Out_Of_Range` is - raised as an error, unless `error_on_missing_columns` is set to - `False`, in which case the problem is reported according to the - `on_problems` setting. - If any column names in the new table are clashing, a `Duplicate_Output_Column_Names` is reported according to the `on_problems` setting. @id_fields Widget_Helpers.make_column_name_vector_selector - transpose : Vector (Integer | Text | Column_Selector) | Text | Integer -> Text -> Text -> Boolean -> Problem_Behavior -> Table ! No_Output_Columns | Missing_Input_Columns | Column_Indexes_Out_Of_Range | Duplicate_Output_Column_Names + transpose : Vector (Integer | Text | Column_Selector) | Text | Integer -> Text -> Text -> Boolean -> Problem_Behavior -> Table ! No_Output_Columns | Missing_Input_Columns | Duplicate_Output_Column_Names transpose self id_fields=[] (name_field="Name") (value_field="Value") (error_on_missing_columns=True) (on_problems = Report_Warning) = ## Avoid unused arguments warning. We cannot rename arguments to `_`, because we need to keep the API consistent with the in-memory table. @@ -1426,8 +1401,6 @@ type Table - If a column in `group_by` or `name_field` is not in the input table, a `Missing_Input_Columns` is raised as a dataflow error. - - If a column index in `group_by`, `name_field` or `values` is out of - range, a `Column_Indexes_Out_Of_Range` is raised as a dataflow error. - If a column selector in `values` given as a `Text` and it does not match any columns in the input table nor is it a valid expression, an `Invalid_Aggregate_Column` dataflow error is raised. @@ -1444,7 +1417,7 @@ type Table @group_by Widget_Helpers.make_column_name_vector_selector @name_column Widget_Helpers.make_column_name_selector @values (Widget_Helpers.make_aggregate_column_selector include_group_by=False) - cross_tab : Vector (Integer | Text | Column_Selector | Aggregate_Column) | Text | Integer -> (Text | Integer) -> Aggregate_Column | Vector Aggregate_Column -> Problem_Behavior -> Table ! Missing_Input_Columns | Column_Indexes_Out_Of_Range | Invalid_Aggregate_Column | Floating_Point_Equality | Invalid_Aggregation | Unquoted_Delimiter | Additional_Warnings + cross_tab : Vector (Integer | Text | Column_Selector | Aggregate_Column) | Text | Integer -> (Text | Integer) -> Aggregate_Column | Vector Aggregate_Column -> Problem_Behavior -> Table ! Missing_Input_Columns | Invalid_Aggregate_Column | Floating_Point_Equality | Invalid_Aggregation | Unquoted_Delimiter | Additional_Warnings cross_tab self group_by=[] name_column=self.column_names.first values=Aggregate_Column.Count (on_problems=Report_Warning) = ## Avoid unused arguments warning. We cannot rename arguments to `_`, because we need to keep the API consistent with the in-memory table. @@ -1488,9 +1461,6 @@ type Table - If a column in `columns` is not in the input table, a `Missing_Input_Columns` is raised as an error or problem following the `error_on_missing_columns` rules. - - If a column index is out of range, a `Column_Indexes_Out_Of_Range` is - raised as an error or problem following the - `error_on_missing_columns` rules. - If a column selected for parsing is not a text column, an `Invalid_Value_Type` error is raised. - If no columns have been selected for parsing, diff --git a/distribution/lib/Standard/Table/0.0.0-dev/src/Data/Table.enso b/distribution/lib/Standard/Table/0.0.0-dev/src/Data/Table.enso index 4e22bcd1d295..056f6a14433e 100644 --- a/distribution/lib/Standard/Table/0.0.0-dev/src/Data/Table.enso +++ b/distribution/lib/Standard/Table/0.0.0-dev/src/Data/Table.enso @@ -289,10 +289,6 @@ type Table `Missing_Input_Columns` is raised as an error, unless `error_on_missing_columns` is set to `False`, in which case the problem is reported according to the `on_problems` setting. - - If a column index is out of range, a `Column_Indexes_Out_Of_Range` is - raised as an error, unless `error_on_missing_columns` is set to - `False`, in which case the problem is reported according to the - `on_problems` setting. > Example Select columns by name. @@ -316,7 +312,7 @@ type Table Icon: select_column @columns Widget_Helpers.make_column_name_vector_selector - select_columns : Vector (Integer | Text | Column_Selector) | Text | Integer -> Boolean -> Boolean -> Problem_Behavior -> Table ! No_Output_Columns | Missing_Input_Columns | Column_Indexes_Out_Of_Range + select_columns : Vector (Integer | Text | Column_Selector) | Text | Integer -> Boolean -> Boolean -> Problem_Behavior -> Table ! No_Output_Columns | Missing_Input_Columns select_columns self columns=[self.columns.first.name] (reorder = False) (error_on_missing_columns = True) (on_problems = Report_Warning) = new_columns = self.columns_helper.select_columns selectors=columns reorder=reorder error_on_missing_columns=error_on_missing_columns on_problems=on_problems Table.new new_columns @@ -345,10 +341,6 @@ type Table `Missing_Input_Columns` is reported according to the `on_problems` setting, unless `error_on_missing_columns` is set to `True`, in which case it is raised as an error. - - If a column index is out of range, a `Column_Indexes_Out_Of_Range` is - reported according to the `on_problems` setting, unless - `error_on_missing_columns` is set to `True`, in which case it is - raised as an error. > Example Remove columns with given names. @@ -370,7 +362,7 @@ type Table table.remove_columns [-1, 0, 1] @columns Widget_Helpers.make_column_name_vector_selector - remove_columns : Vector (Integer | Text | Column_Selector) | Text | Integer -> Boolean -> Problem_Behavior -> Table ! No_Output_Columns | Missing_Input_Columns | Column_Indexes_Out_Of_Range + remove_columns : Vector (Integer | Text | Column_Selector) | Text | Integer -> Boolean -> Problem_Behavior -> Table ! No_Output_Columns | Missing_Input_Columns remove_columns self (columns=[self.columns.first.name]) (error_on_missing_columns = False) (on_problems = Report_Warning) = new_columns = self.columns_helper.remove_columns selectors=columns error_on_missing_columns=error_on_missing_columns on_problems=on_problems Table.new new_columns @@ -396,10 +388,6 @@ type Table `Missing_Input_Columns` is reported according to the `on_problems` setting, unless `error_on_missing_columns` is set to `True`, in which case it is raised as an error. - - If a column index is out of range, a `Column_Indexes_Out_Of_Range` is - reported according to the `on_problems` setting, unless - `error_on_missing_columns` is set to `True`, in which case it is - raised as an error. > Example Move a column with a specified name to back. @@ -426,7 +414,7 @@ type Table table.reorder_columns [0] position=Position.After_Other_Columns @columns Widget_Helpers.make_column_name_vector_selector - reorder_columns : Vector (Integer | Text | Column_Selector) | Text | Integer -> Position -> Boolean -> Problem_Behavior -> Table ! Missing_Input_Columns | Column_Indexes_Out_Of_Range + reorder_columns : Vector (Integer | Text | Column_Selector) | Text | Integer -> Position -> Boolean -> Problem_Behavior -> Table ! Missing_Input_Columns reorder_columns self (columns = [self.columns.first.name]) (position = Position.Before_Other_Columns) (error_on_missing_columns = False) (on_problems = Report_Warning) = new_columns = self.columns_helper.reorder_columns selectors=columns position=position error_on_missing_columns=error_on_missing_columns on_problems=on_problems Table.new new_columns @@ -476,10 +464,6 @@ type Table `Missing_Input_Columns` is raised as an error, unless `error_on_missing_columns` is set to `False`, in which case the problem is reported according to the `on_problems` setting. - - If a column index is out of range, a `Column_Indexes_Out_Of_Range` is - raised as an error, unless `error_on_missing_columns` is set to - `False`, in which case the problem is reported according to the - `on_problems` setting. - Other problems are reported according to the `on_problems` setting: - If a column is matched by two selectors resulting in a different name mapping, a `Ambiguous_Column_Rename`. @@ -521,7 +505,7 @@ type Table by_name = Column_Selector.By_Name "name=(.*)" Case_Sensitivity.Sensitive use_regex=True table.rename_columns (Map.from_vector [[by_name, "key:$1"]]) @column_map Widget_Helpers.make_rename_name_vector_selector - rename_columns : Map (Text | Integer | Column_Selector) Text | Vector Text | Vector Vector -> Boolean -> Problem_Behavior -> Table ! Missing_Input_Columns | Column_Indexes_Out_Of_Range | Ambiguous_Column_Rename | Too_Many_Column_Names_Provided | Invalid_Output_Column_Names | Duplicate_Output_Column_Names + rename_columns : Map (Text | Integer | Column_Selector) Text | Vector Text | Vector Vector -> Boolean -> Problem_Behavior -> Table ! Missing_Input_Columns | Ambiguous_Column_Rename | Too_Many_Column_Names_Provided | Invalid_Output_Column_Names | Duplicate_Output_Column_Names rename_columns self column_map=["Column"] (error_on_missing_columns=True) (on_problems=Report_Warning) = new_names = Table_Helpers.rename_columns internal_columns=self.columns mapping=column_map error_on_missing_columns=error_on_missing_columns on_problems=on_problems Warning.with_suspended new_names names-> @@ -572,7 +556,7 @@ type Table - If there are no columns in the output table, a `No_Output_Columns` is raised as an error regardless of the problem behavior, because it is not possible to create a table without any columns. - - If a column index is out of range, a `Column_Indexes_Out_Of_Range` is + - If a column index is out of range, a `Missing_Input_Columns` is reported according to the `on_problems` setting, unless `error_on_missing_columns` is set to `True`, in which case it is raised as an error. Problems resolving `Group_By` columns are @@ -641,10 +625,6 @@ type Table `Missing_Input_Columns` is raised as an error, unless `error_on_missing_columns` is set to `False`, in which case the problem is reported according to the `on_problems` setting. - - If a column index is out of range, a `Column_Indexes_Out_Of_Range` is - raised as an error, unless `error_on_missing_columns` is set to - `False`, in which case the problem is reported according to the - `on_problems` setting. - If no columns have been selected for ordering, a `No_Input_Columns_Selected` is raised as dataflow error regardless of any settings. @@ -690,7 +670,7 @@ type Table table.order_by [(Sort_Column.Select_By_Name "a.*" use_regex=True case_sensitivity=Case_Sensitivity.Insensitive)] @columns Widget_Helpers.make_order_by_selector - order_by : Vector (Text | Sort_Column) | Text -> Text_Ordering -> Boolean -> Problem_Behavior -> Table ! Incomparable_Values | No_Input_Columns_Selected | Missing_Input_Columns | Column_Indexes_Out_Of_Range + order_by : Vector (Text | Sort_Column) | Text -> Text_Ordering -> Boolean -> Problem_Behavior -> Table ! Incomparable_Values | No_Input_Columns_Selected | Missing_Input_Columns order_by self (columns = [self.columns.first.name]) text_ordering=Text_Ordering.Default error_on_missing_columns=True on_problems=Problem_Behavior.Report_Warning = problem_builder = Problem_Builder.new error_on_missing_columns=error_on_missing_columns types_to_always_throw=[No_Input_Columns_Selected] columns_for_ordering = Table_Helpers.prepare_order_by self.columns columns problem_builder @@ -797,9 +777,6 @@ type Table - If a column in `columns` is not in the input table, a `Missing_Input_Columns` is raised as an error or problem following the `error_on_missing_columns` rules. - - If a column index is out of range, a `Column_Indexes_Out_Of_Range` is - raised as an error or problem following the - `error_on_missing_columns` rules. - If a column selected for parsing is not a text column, an `Invalid_Value_Type` error is raised. - If no columns have been selected for parsing, @@ -1216,8 +1193,7 @@ type Table ! Error Conditions - If the columns specified in `group_by` or `order_by` are not present - in the table, a `Missing_Input_Columns` or - `Column_Indexes_Out_Of_Range` error is raised. + in the table, a `Missing_Input_Columns` error is raised. - If the column with the same name as provided `name` already exists, a `Duplicate_Output_Column_Names` problem is reported and the existing column is renamed to avoid the clash. @@ -1776,15 +1752,11 @@ type Table `Missing_Input_Columns` is raised as an error, unless `error_on_missing_columns` is set to `False`, in which case the problem is reported according to the `on_problems` setting. - - If a column index is out of range, a `Column_Indexes_Out_Of_Range` is - raised as an error, unless `error_on_missing_columns` is set to - `False`, in which case the problem is reported according to the - `on_problems` setting. - If any column names in the new table are clashing, a `Duplicate_Output_Column_Names` is reported according to the `on_problems` setting. @id_fields Widget_Helpers.make_column_name_vector_selector - transpose : Vector (Integer | Text | Column_Selector) | Text | Integer -> Text -> Text -> Boolean -> Problem_Behavior -> Table ! No_Output_Columns | Missing_Input_Columns | Column_Indexes_Out_Of_Range | Duplicate_Output_Column_Names + transpose : Vector (Integer | Text | Column_Selector) | Text | Integer -> Text -> Text -> Boolean -> Problem_Behavior -> Table ! No_Output_Columns | Missing_Input_Columns | Duplicate_Output_Column_Names transpose self (id_fields = []) (name_field="Name") (value_field="Value") (error_on_missing_columns=True) (on_problems = Report_Warning) = columns_helper = self.columns_helper unique = Unique_Name_Strategy.new @@ -1824,8 +1796,6 @@ type Table - If a column in `group_by` or `name_field` is not in the input table, a `Missing_Input_Columns` is raised as a dataflow error. - - If a column index in `group_by`, `name_field` or `values` is out of - range, a `Column_Indexes_Out_Of_Range` is raised as a dataflow error. - If a column selector in `values` given as a `Text` and it does not match any columns in the input table nor is it a valid expression, an `Invalid_Aggregate_Column` dataflow error is raised. @@ -1842,7 +1812,7 @@ type Table @group_by Widget_Helpers.make_column_name_vector_selector @name_column Widget_Helpers.make_column_name_selector @values (Widget_Helpers.make_aggregate_column_selector include_group_by=False) - cross_tab : Vector (Integer | Text | Column_Selector | Aggregate_Column) | Text | Integer -> (Text | Integer) -> Aggregate_Column | Vector Aggregate_Column -> Problem_Behavior -> Table ! Missing_Input_Columns | Column_Indexes_Out_Of_Range | Invalid_Aggregate_Column | Floating_Point_Equality | Invalid_Aggregation | Unquoted_Delimiter | Additional_Warnings + cross_tab : Vector (Integer | Text | Column_Selector | Aggregate_Column) | Text | Integer -> (Text | Integer) -> Aggregate_Column | Vector Aggregate_Column -> Problem_Behavior -> Table ! Missing_Input_Columns | Invalid_Aggregate_Column | Floating_Point_Equality | Invalid_Aggregation | Unquoted_Delimiter | Additional_Warnings cross_tab self group_by=[] name_column=self.column_names.first values=Aggregate_Column.Count (on_problems=Report_Warning) = columns_helper = self.columns_helper problem_builder = Problem_Builder.new error_on_missing_columns=True diff --git a/distribution/lib/Standard/Table/0.0.0-dev/src/Errors.enso b/distribution/lib/Standard/Table/0.0.0-dev/src/Errors.enso index 57040b29d294..591d632135f2 100644 --- a/distribution/lib/Standard/Table/0.0.0-dev/src/Errors.enso +++ b/distribution/lib/Standard/Table/0.0.0-dev/src/Errors.enso @@ -14,12 +14,12 @@ type Missing_Input_Columns One or more columns not found in the input table. Arguments: - - criteria: the names of the columns or regular expressions that did not - have any matches. + - criteria: the names of the columns, regular expressions or indices that + did not matches any columns. - where: an optional text describing to which object this error is related to (for example in join, whether the reported error is for the left or right table). - Error (criteria : [Text]) (where:Text|Nothing = Nothing) + Error (criteria : [Text | Integer]) (where:Text|Nothing = Nothing) ## PRIVATE @@ -29,21 +29,11 @@ type Missing_Input_Columns where = case self.where of Nothing -> "." location : Text -> " in "+location+"." - "The criteria "+self.criteria.to_text+" did not match any columns"+where - -type Column_Indexes_Out_Of_Range - ## PRIVATE - One or more column indexes were invalid on the input table. - Can occur when using By_Index. - Error (indexes : [Integer]) - - ## PRIVATE - - Convert a column indexes out of bounds error to a human-readable form. - to_display_text : Text - to_display_text self = case self.indexes.length == 1 of - True -> "The index " + (self.indexes.at 0).to_text + " is out of range." - False -> "The indexes "+self.indexes.short_display_text+" are out of range." + criteria_texts = self.criteria.map c-> case c of + _ : Integer -> c.to_text+" (index)" + _ -> c.pretty + criteria_text = criteria_texts.join ", " + "The criteria "+criteria_text+" did not match any columns"+where type Too_Many_Column_Names_Provided ## PRIVATE diff --git a/distribution/lib/Standard/Table/0.0.0-dev/src/Internal/Join_Helpers.enso b/distribution/lib/Standard/Table/0.0.0-dev/src/Internal/Join_Helpers.enso index abdd958ea67d..f837672125a9 100644 --- a/distribution/lib/Standard/Table/0.0.0-dev/src/Internal/Join_Helpers.enso +++ b/distribution/lib/Standard/Table/0.0.0-dev/src/Internal/Join_Helpers.enso @@ -2,7 +2,7 @@ from Standard.Base import all import Standard.Base.Errors.Common.Index_Out_Of_Bounds import Standard.Base.Errors.Illegal_State.Illegal_State -from project.Errors import Invalid_Value_Type, No_Such_Column, Missing_Input_Columns, Column_Indexes_Out_Of_Range +from project.Errors import Invalid_Value_Type, No_Such_Column, Missing_Input_Columns import project.Data.Join_Condition.Join_Condition import project.Data.Type.Value_Type.Value_Type import project.Internal.Problem_Builder.Problem_Builder @@ -23,8 +23,8 @@ type Join_Condition_Resolver resolve : Join_Condition | Text | Vector (Join_Condition | Text) -> Problem_Behavior -> Join_Condition_Resolution resolve self conditions on_problems = redundant_names = Vector.new_builder - left_problem_builder = Problem_Builder.new missing_input_columns_location="the left table" types_to_always_throw=[Missing_Input_Columns, Column_Indexes_Out_Of_Range] - right_problem_builder = Problem_Builder.new missing_input_columns_location="the right table" types_to_always_throw=[Missing_Input_Columns, Column_Indexes_Out_Of_Range] + left_problem_builder = Problem_Builder.new missing_input_columns_location="the left table" types_to_always_throw=[Missing_Input_Columns] + right_problem_builder = Problem_Builder.new missing_input_columns_location="the right table" types_to_always_throw=[Missing_Input_Columns] resolve_selector problem_builder resolver selector = r_1 = resolver selector diff --git a/distribution/lib/Standard/Table/0.0.0-dev/src/Internal/Problem_Builder.enso b/distribution/lib/Standard/Table/0.0.0-dev/src/Internal/Problem_Builder.enso index 901ac040e51f..0ff67c2f620a 100644 --- a/distribution/lib/Standard/Table/0.0.0-dev/src/Internal/Problem_Builder.enso +++ b/distribution/lib/Standard/Table/0.0.0-dev/src/Internal/Problem_Builder.enso @@ -3,7 +3,7 @@ import Standard.Base.Runtime.Ref.Ref import project.Internal.Vector_Builder.Vector_Builder -from project.Errors import Missing_Input_Columns, Column_Indexes_Out_Of_Range, Duplicate_Output_Column_Names, Invalid_Output_Column_Names, Invalid_Aggregate_Column +from project.Errors import Missing_Input_Columns, Duplicate_Output_Column_Names, Invalid_Output_Column_Names, Invalid_Aggregate_Column ## PRIVATE type Problem_Builder @@ -34,13 +34,10 @@ type Problem_Builder build_problemset : Vector build_problemset self = problems = Vector.new_builder - build_vector_and_append ref problem_creator = - vec = ref.get . build - if vec.not_empty then - problems.append (problem_creator vec) - build_vector_and_append self.missing_input_columns (Missing_Input_Columns.Error _ where=self.missing_input_columns_location) - build_vector_and_append self.oob_indices Column_Indexes_Out_Of_Range.Error + missing_criteria = self.missing_input_columns.get.build + self.oob_indices.get.build + if missing_criteria.not_empty then + problems.append (Missing_Input_Columns.Error missing_criteria where=self.missing_input_columns_location) self.other.to_vector.each problems.append problems.to_vector @@ -87,15 +84,15 @@ type Problem_Builder an error by the `attach_` methods regardless of the `Problem_Behavior` used. By default, an empty vector. - error_on_missing_columns: If set to `True`, `Missing_Input_Columns` and - `Column_Indexes_Out_Of_Range` will be raised as errors by the `attach_` + `Invalid_Aggregate_Column` will be raised as errors by the `attach_` methods regardless of the `Problem_Behavior` used. Defaults to `False`. - Setting this to `True` is essentially a shorthand for adding these two + Setting this to `True` is essentially a shorthand for adding these problem types to `types_to_always_throw`. - missing_input_columns_location: The location to add to the missing input column error to make it more informative. Defaults to `Nothing`. new : Vector -> Boolean -> Text | Nothing -> Problem_Builder new types_to_always_throw=[] error_on_missing_columns=False missing_input_columns_location=Nothing = - additional_types_to_throw = if error_on_missing_columns then [Missing_Input_Columns, Column_Indexes_Out_Of_Range, Invalid_Aggregate_Column] else [] + additional_types_to_throw = if error_on_missing_columns then [Missing_Input_Columns, Invalid_Aggregate_Column] else [] Problem_Builder.Value types_to_always_throw+additional_types_to_throw (Ref.new Vector_Builder.empty) (Ref.new Vector_Builder.empty) missing_input_columns_location other=Vector.new_builder ## PRIVATE diff --git a/test/Table_Tests/src/Common_Table_Operations/Add_Row_Number_Spec.enso b/test/Table_Tests/src/Common_Table_Operations/Add_Row_Number_Spec.enso index 314909262370..f39d8a8df8ec 100644 --- a/test/Table_Tests/src/Common_Table_Operations/Add_Row_Number_Spec.enso +++ b/test/Table_Tests/src/Common_Table_Operations/Add_Row_Number_Spec.enso @@ -1,7 +1,7 @@ from Standard.Base import all from Standard.Table import Sort_Column -from Standard.Table.Errors import Missing_Input_Columns, Column_Indexes_Out_Of_Range, Duplicate_Output_Column_Names, Floating_Point_Equality +from Standard.Table.Errors import Missing_Input_Columns, Duplicate_Output_Column_Names, Floating_Point_Equality from Standard.Test import Test, Problems import Standard.Test.Extensions @@ -124,4 +124,4 @@ spec setup = r2.catch.criteria . should_equal ["Z", "Y"] r3 = t.add_row_number group_by=[44] - r3.should_fail_with Column_Indexes_Out_Of_Range + r3.should_fail_with Missing_Input_Columns 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 8f691bdeefdb..debe577c718a 100644 --- a/test/Table_Tests/src/Common_Table_Operations/Aggregate_Spec.enso +++ b/test/Table_Tests/src/Common_Table_Operations/Aggregate_Spec.enso @@ -1321,8 +1321,8 @@ spec setup = t2.catch.name.should_equal "MISSING" t3 = table.aggregate [Sum 42] - t3 . should_fail_with Column_Indexes_Out_Of_Range - t3.catch.indexes.should_equal [42] + t3 . should_fail_with Missing_Input_Columns + t3.catch.criteria.should_equal [42] Test.specify "should raise a warning when can't find a column by name, but a hard error if the missing column is in a Group_By" <| err1 = table.aggregate [Group_By "Missing", Group_By "Index", Group_By "Other_Missing"] on_problems=Problem_Behavior.Ignore @@ -1347,21 +1347,21 @@ spec setup = err3.catch.name.should_equal "Missing" err4 = table.aggregate [Group_By 100, Group_By "Index", Group_By -42] on_problems=Problem_Behavior.Ignore - err4.should_fail_with Column_Indexes_Out_Of_Range - err4.catch.indexes.should_equal [100, -42] + err4.should_fail_with Missing_Input_Columns + err4.catch.criteria.should_equal [100, -42] action2 = table.aggregate [Group_By "Index", Sum "Value", Sum 42] on_problems=_ - problems2 = [Column_Indexes_Out_Of_Range.Error [42]] + problems2 = [Missing_Input_Columns.Error [42]] tester2 = expect_column_names ["Index", "Sum Value"] Problems.test_problem_handling action2 problems2 tester2 # As above, missing errors from group-by take precedence over aggregates. err5 = table.aggregate [Group_By "Index", Group_By 55, Sum "Value", Sum 144, Group_By -33] on_problems=Problem_Behavior.Report_Error - err5.should_fail_with Column_Indexes_Out_Of_Range - err5.catch.indexes.should_equal [55, -33] + err5.should_fail_with Missing_Input_Columns + err5.catch.criteria.should_equal [55, -33] err6 = table.aggregate [Group_By "Index", Sum "Value", Sum 42] on_problems=Problem_Behavior.Ignore error_on_missing_columns=True - err6.catch . should_equal (Column_Indexes_Out_Of_Range.Error [42]) + err6.catch . should_equal (Missing_Input_Columns.Error [42]) Test.specify "should raise a warning when an invalid output name" <| action = table.aggregate [Group_By "Index" ""] on_problems=_ @@ -1395,7 +1395,7 @@ spec setup = Test.specify "should ignore Count_Distinct if no columns matched" <| action = table.aggregate [Count_Distinct [-100], Count] on_problems=_ - problems = [Column_Indexes_Out_Of_Range.Error [-100]] + problems = [Missing_Input_Columns.Error [-100]] tester = expect_column_names ["Count"] Problems.test_problem_handling action problems tester diff --git a/test/Table_Tests/src/Common_Table_Operations/Cross_Tab_Spec.enso b/test/Table_Tests/src/Common_Table_Operations/Cross_Tab_Spec.enso index bfe835b49b98..775100059f7e 100644 --- a/test/Table_Tests/src/Common_Table_Operations/Cross_Tab_Spec.enso +++ b/test/Table_Tests/src/Common_Table_Operations/Cross_Tab_Spec.enso @@ -110,8 +110,8 @@ spec setup = err1.catch.criteria . should_equal ["Name"] err2 = table.cross_tab [] 42 - err2.should_fail_with Column_Indexes_Out_Of_Range - err2.catch.indexes . should_equal [42] + err2.should_fail_with Missing_Input_Columns + err2.catch.criteria . should_equal [42] Test.specify "should fail if group-by contains missing columns" <| err1 = table2.cross_tab ["Group", "Nonexistent Group", "OTHER"] "Key" @@ -119,8 +119,8 @@ spec setup = err1.catch.criteria . should_equal ["Nonexistent Group", "OTHER"] err2 = table2.cross_tab [0, 42] "Key" - err2.should_fail_with Column_Indexes_Out_Of_Range - err2.catch.indexes . should_equal [42] + err2.should_fail_with Missing_Input_Columns + err2.catch.criteria . should_equal [42] Test.specify "should fail if aggregate values contain missing columns" <| err1 = table.cross_tab values=[Count, Sum "Nonexistent Value", Sum "Value", Sum "OTHER"] @@ -128,8 +128,8 @@ spec setup = err1.catch.name . should_equal "Nonexistent Value" err2 = table.cross_tab values=[Count, Sum "Nonexistent Value", Sum "Value", Sum 42] - err2.should_fail_with Column_Indexes_Out_Of_Range - err2.catch.indexes . should_equal [42] + err2.should_fail_with Missing_Input_Columns + err2.catch.criteria . should_equal [42] Test.specify "should fail if aggregate values contain invalid expressions" <| err1 = table.cross_tab values=[Sum "[MISSING]*10"] diff --git a/test/Table_Tests/src/Common_Table_Operations/Distinct_Spec.enso b/test/Table_Tests/src/Common_Table_Operations/Distinct_Spec.enso index 4063525ce389..84d7d698cc34 100644 --- a/test/Table_Tests/src/Common_Table_Operations/Distinct_Spec.enso +++ b/test/Table_Tests/src/Common_Table_Operations/Distinct_Spec.enso @@ -104,8 +104,8 @@ spec setup = t3.catch . should_equal (Missing_Input_Columns.Error ["Y"]) t4 = t1.distinct [0, 42] on_problems=pb - t4.should_fail_with Column_Indexes_Out_Of_Range - t4.catch . should_equal (Column_Indexes_Out_Of_Range.Error [42]) + t4.should_fail_with Missing_Input_Columns + t4.catch . should_equal (Missing_Input_Columns.Error [42]) t5 = t1.distinct [] on_problems=pb t5.should_fail_with No_Input_Columns_Selected @@ -126,5 +126,5 @@ spec setup = action3 = t1.distinct [0, 42] error_on_missing_columns=False on_problems=_ tester3 table = table.at "X" . to_vector . should_equal [1, 2, 3] - problems3 = [Column_Indexes_Out_Of_Range.Error [42]] + problems3 = [Missing_Input_Columns.Error [42]] Problems.test_problem_handling action3 problems3 tester3 diff --git a/test/Table_Tests/src/Common_Table_Operations/Join/Join_Spec.enso b/test/Table_Tests/src/Common_Table_Operations/Join/Join_Spec.enso index 910080636bea..e3b509a4073c 100644 --- a/test/Table_Tests/src/Common_Table_Operations/Join/Join_Spec.enso +++ b/test/Table_Tests/src/Common_Table_Operations/Join/Join_Spec.enso @@ -292,23 +292,19 @@ spec setup = r1 = t1.join t2 r1.should_fail_with Missing_Input_Columns r1.catch.criteria.should_equal ["X"] - r1.catch.to_display_text.should_equal "The criteria [X] did not match any columns in the right table." + r1.catch.to_display_text.should_equal "The criteria 'X' did not match any columns in the right table." - conditions = [Join_Condition.Equals "foo" 42, Join_Condition.Equals "X" -3, Join_Condition.Equals -1 "baz"] - - r2 = t1.join t2 on=conditions on_problems=Problem_Behavior.Ignore - ## We have both - - Column_Indexes_Out_Of_Range.Error [42, -3] - - Missing_Input_Columns.Error ["foo", "baz"] - here, but we can throw only one error. I think column names error - will be more useful, so I'd prioritize it. + conditions2 = [Join_Condition.Equals "foo" 42, Join_Condition.Equals "X" -3, Join_Condition.Equals -1 "baz"] + r2 = t1.join t2 on=conditions2 on_problems=Problem_Behavior.Ignore r2.should_fail_with Missing_Input_Columns r2.catch.criteria.should_equal ["foo"] - r2.catch.to_display_text.should_equal "The criteria [foo] did not match any columns in the left table." + r2.catch.to_display_text.should_equal "The criteria 'foo' did not match any columns in the left table." - r3 = t1.join t2 on=[Join_Condition.Equals 42 0] on_problems=Problem_Behavior.Ignore - r3.should_fail_with Column_Indexes_Out_Of_Range - r3.catch.indexes.should_equal [42] + conditions3 = [Join_Condition.Equals "Y" 42, Join_Condition.Equals "X" -3, Join_Condition.Equals -1 "baz"] + r3 = t1.join t2 on=conditions3 on_problems=Problem_Behavior.Ignore + r3.should_fail_with Missing_Input_Columns + r3.catch.criteria.should_equal ["baz", 42, -3] + r3.catch.to_display_text.should_equal "The criteria 'baz', 42 (index), -3 (index) did not match any columns in the right table." Test.specify "should report Invalid_Value_Type if non-text columns are provided to Equals_Ignore_Case" <| t1 = table_builder [["X", ["1", "2", "c"]], ["Y", [1, 2, 3]]] diff --git a/test/Table_Tests/src/Common_Table_Operations/Order_By_Spec.enso b/test/Table_Tests/src/Common_Table_Operations/Order_By_Spec.enso index 377fb4bb312c..e10cbd1df364 100644 --- a/test/Table_Tests/src/Common_Table_Operations/Order_By_Spec.enso +++ b/test/Table_Tests/src/Common_Table_Operations/Order_By_Spec.enso @@ -84,9 +84,9 @@ spec setup = Test.specify "should correctly handle problems: out of bounds indices" <| selector = [0, 100, Sort_Column.Index -200, Sort_Column.Index 300] - expected_problem = Column_Indexes_Out_Of_Range.Error [100, -200, 300] + expected_problem = Missing_Input_Columns.Error [100, -200, 300] t1 = table.order_by selector - t1.should_fail_with Column_Indexes_Out_Of_Range + t1.should_fail_with Missing_Input_Columns t1.catch . should_equal expected_problem action = table.order_by selector error_on_missing_columns=False on_problems=_ diff --git a/test/Table_Tests/src/Common_Table_Operations/Select_Columns_Spec.enso b/test/Table_Tests/src/Common_Table_Operations/Select_Columns_Spec.enso index b79d762f1b8c..9c630a0ffd40 100644 --- a/test/Table_Tests/src/Common_Table_Operations/Select_Columns_Spec.enso +++ b/test/Table_Tests/src/Common_Table_Operations/Select_Columns_Spec.enso @@ -70,11 +70,11 @@ spec setup = selector = [1, 0, 100, -200, 300] action = table.select_columns selector error_on_missing_columns=False on_problems=_ tester = expect_column_names ["foo", "bar"] - problems = [Column_Indexes_Out_Of_Range.Error [100, -200, 300]] + problems = [Missing_Input_Columns.Error [100, -200, 300]] Problems.test_problem_handling action problems tester err = table.select_columns selector - err.should_fail_with Column_Indexes_Out_Of_Range + err.should_fail_with Missing_Input_Columns Test.specify "should correctly handle edge-cases: duplicate indices" <| selector = [0, 0, 0] @@ -126,11 +126,7 @@ spec setup = Test.specify "should correctly handle problems in mixed case" <| err = table.select_columns ["foo", "hmm", 99] on_problems=Problem_Behavior.Ignore err.should_fail_with Missing_Input_Columns - err.catch.criteria . should_equal ["hmm"] - - err_2 = table.select_columns [99, "foo", "hmm"] on_problems=Problem_Behavior.Ignore - err_2.should_fail_with Missing_Input_Columns - err_2.catch.criteria . should_equal ["hmm"] + err.catch.criteria . should_equal ["hmm", 99] Test.specify "should correctly handle problems: no columns in the output" <| [Problem_Behavior.Ignore, Problem_Behavior.Report_Warning, Problem_Behavior.Report_Error].each pb-> @@ -174,11 +170,11 @@ spec setup = selector = [1, 0, 100, -200, 300] action = table.remove_columns selector on_problems=_ tester = expect_column_names ["Baz", "foo 1", "foo 2", "ab.+123", "abcd123"] - problems = [Column_Indexes_Out_Of_Range.Error [100, -200, 300]] + problems = [Missing_Input_Columns.Error [100, -200, 300]] Problems.test_problem_handling action problems tester err = table.remove_columns selector error_on_missing_columns=True - err.should_fail_with Column_Indexes_Out_Of_Range + err.should_fail_with Missing_Input_Columns Test.specify "should correctly handle edge-cases: duplicate indices" <| selector = [0, 0, 0] @@ -256,11 +252,11 @@ spec setup = selector = [1, 0, 100, -200, 300] action = table.reorder_columns selector on_problems=_ tester = expect_column_names ["bar", "foo", "Baz", "foo 1", "foo 2", "ab.+123", "abcd123"] - problems = [Column_Indexes_Out_Of_Range.Error [100, -200, 300]] + problems = [Missing_Input_Columns.Error [100, -200, 300]] Problems.test_problem_handling action problems tester err = table.reorder_columns selector error_on_missing_columns=True - err.should_fail_with Column_Indexes_Out_Of_Range + err.should_fail_with Missing_Input_Columns Test.specify "should correctly handle edge-cases: duplicate indices" <| selector = [0, 0, 0] @@ -393,12 +389,12 @@ spec setup = action = table.rename_columns map error_on_missing_columns=False on_problems=_ tester = expect_column_names ["FirstColumn", "beta", "gamma", "Another"] err_checker err = - err.catch.should_be_a Column_Indexes_Out_Of_Range.Error - err.catch.indexes.should_contain_the_same_elements_as [-200, 100, 300] + err.catch.should_be_a Missing_Input_Columns.Error + err.catch.criteria.should_contain_the_same_elements_as [-200, 100, 300] Problems.test_advanced_problem_handling action err_checker (x-> x) tester err = table.rename_columns map - err.should_fail_with Column_Indexes_Out_Of_Range + err.should_fail_with Missing_Input_Columns Test.specify "should correctly handle edge-cases: aliased indices" <| map1 = Map.from_vector [[1, "FirstColumn"], [-3, "FirstColumn"]] diff --git a/test/Table_Tests/src/Common_Table_Operations/Transpose_Spec.enso b/test/Table_Tests/src/Common_Table_Operations/Transpose_Spec.enso index 1fa3b63e4f0e..2e1a833c1422 100644 --- a/test/Table_Tests/src/Common_Table_Operations/Transpose_Spec.enso +++ b/test/Table_Tests/src/Common_Table_Operations/Transpose_Spec.enso @@ -78,8 +78,8 @@ spec setup = err1.catch.criteria . should_equal ["Missing", "Missing 2"] err2 = t1.transpose [0, -1, 42, -100] - err2.should_fail_with Column_Indexes_Out_Of_Range - err2.catch.indexes . should_equal [42, -100] + err2.should_fail_with Missing_Input_Columns + err2.catch.criteria . should_equal [42, -100] action1 = t1.transpose ["Key", "Missing", "Missing 2"] error_on_missing_columns=False on_problems=_ tester1 table = @@ -90,7 +90,7 @@ spec setup = action2 = t1.transpose [0, -1, 42, -100] error_on_missing_columns=False on_problems=_ tester2 table = table.column_names . should_equal ["Key", "Another", "Name", "Value"] - problems2 = [Column_Indexes_Out_Of_Range.Error [42, -100]] + problems2 = [Missing_Input_Columns.Error [42, -100]] Problems.test_problem_handling action2 problems2 tester2 Test.specify "should warn on column name clashes" <| diff --git a/test/Table_Tests/src/Formatting/Parse_Values_Spec.enso b/test/Table_Tests/src/Formatting/Parse_Values_Spec.enso index cd9881e87c35..95565e66e6da 100644 --- a/test/Table_Tests/src/Formatting/Parse_Values_Spec.enso +++ b/test/Table_Tests/src/Formatting/Parse_Values_Spec.enso @@ -334,13 +334,13 @@ spec = Test.specify "should correctly handle problems: out of bounds indices" <| t1 = Table.new [["A", ["1", "2", "3"]]] r1 = t1.parse columns=[0, -1, 42, -5] - r1.should_fail_with Column_Indexes_Out_Of_Range - r1.catch.indexes . should_equal [42, -5] + r1.should_fail_with Missing_Input_Columns + r1.catch.criteria . should_equal [42, -5] action = t1.parse columns=[0, -1, 42, -5] error_on_missing_columns=False on_problems=_ tester table = table.at "A" . to_vector . should_equal [1, 2, 3] - problems = [Column_Indexes_Out_Of_Range.Error [42, -5]] + problems = [Missing_Input_Columns.Error [42, -5]] Problems.test_problem_handling action problems tester Test.specify "should allow mixed column selectors" <| @@ -386,8 +386,7 @@ spec = r4 = t1.parse columns=["nonexistent column :D", -42] error_on_missing_columns=False on_problems=Problem_Behavior.Report_Warning r4 . should_equal t1 Problems.expect_warning No_Input_Columns_Selected r4 - Problems.expect_warning (Missing_Input_Columns.Error ["nonexistent column :D"]) r4 - Problems.expect_warning (Column_Indexes_Out_Of_Range.Error [-42]) r4 + Problems.expect_warning (Missing_Input_Columns.Error ["nonexistent column :D", -42]) r4 Test.group "Column.parse" <| Test.specify "should correctly parse integers" <|