From b8940478689c9db0afbad63e70067cb910a0d606 Mon Sep 17 00:00:00 2001 From: Mark Youngman Date: Tue, 17 Dec 2024 11:54:01 +0000 Subject: [PATCH] EES-5740 Add filter hierarchy test data sets --- .../Models/FilterAndIndicatorValuesReader.cs | 2 +- .../Models/MetaDataFileReader.cs | 2 +- .../filter-hierarchies/filter_hierarchy1.csv | 17 +++++++++++++++++ .../filter_hierarchy1.meta.csv | 4 ++++ .../filter-hierarchies/filter_hierarchy2.csv | 17 +++++++++++++++++ .../filter_hierarchy2.meta.csv | 5 +++++ .../filter-hierarchies/filter_hierarchy3.csv | 17 +++++++++++++++++ .../filter_hierarchy3.meta.csv | 7 +++++++ 8 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy1.csv create mode 100644 tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy1.meta.csv create mode 100644 tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy2.csv create mode 100644 tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy2.meta.csv create mode 100644 tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy3.csv create mode 100644 tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy3.meta.csv diff --git a/src/GovUk.Education.ExploreEducationStatistics.Data.Processor/Models/FilterAndIndicatorValuesReader.cs b/src/GovUk.Education.ExploreEducationStatistics.Data.Processor/Models/FilterAndIndicatorValuesReader.cs index db0957b5475..b97817cbce8 100644 --- a/src/GovUk.Education.ExploreEducationStatistics.Data.Processor/Models/FilterAndIndicatorValuesReader.cs +++ b/src/GovUk.Education.ExploreEducationStatistics.Data.Processor/Models/FilterAndIndicatorValuesReader.cs @@ -77,7 +77,7 @@ public string GetFilterItemLabel( return rowValues[columnIndex].Trim().NullIfWhiteSpace() ?? DefaultFilterItemLabel; } - public string GetFilterGroupLabel( // @MarkFix + public string GetFilterGroupLabel( IReadOnlyList rowValues, Guid filterId) { diff --git a/src/GovUk.Education.ExploreEducationStatistics.Data.Processor/Models/MetaDataFileReader.cs b/src/GovUk.Education.ExploreEducationStatistics.Data.Processor/Models/MetaDataFileReader.cs index 655711916b3..1ab5d82993a 100644 --- a/src/GovUk.Education.ExploreEducationStatistics.Data.Processor/Models/MetaDataFileReader.cs +++ b/src/GovUk.Education.ExploreEducationStatistics.Data.Processor/Models/MetaDataFileReader.cs @@ -42,7 +42,7 @@ public MetaRow GetMetaRow(IReadOnlyList rowValues) ColumnName = ReadMetaColumnValue(MetaColumns.col_name, rowValues), ColumnType = Enum.Parse(columnType!), Label = ReadMetaColumnValue(MetaColumns.label, rowValues), - FilterGroupingColumn = ReadMetaColumnValue(MetaColumns.filter_grouping_column, rowValues), // @MarkFix + FilterGroupingColumn = ReadMetaColumnValue(MetaColumns.filter_grouping_column, rowValues), FilterHint = ReadMetaColumnValue(MetaColumns.filter_hint, rowValues), IndicatorGrouping = ReadMetaColumnValue(MetaColumns.indicator_grouping, rowValues), IndicatorUnit = EnumUtil.GetFromEnumValue(!indicatorUnit.IsNullOrEmpty() ? indicatorUnit : ""), diff --git a/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy1.csv b/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy1.csv new file mode 100644 index 00000000000..14e94abe616 --- /dev/null +++ b/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy1.csv @@ -0,0 +1,17 @@ +time_period,time_identifier,geographic_level,country_code,country_name,old_la_code,new_la_code,la_name,filter_one,filter_two,ind_one +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,One,1 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,One,2 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneOne,One,3 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,One,4 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,Two,5 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneOne,Two,6 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,Two,7 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,Two,8 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneTwo,Three,9 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneTwo,Three,10 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneTwo,Three,11 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneTwo,Three,12 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneTwo,Four,13 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneTwo,Four,14 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneTwo,Four,15 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneTwo,Four,16 diff --git a/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy1.meta.csv b/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy1.meta.csv new file mode 100644 index 00000000000..14834096d63 --- /dev/null +++ b/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy1.meta.csv @@ -0,0 +1,4 @@ +col_name,col_type,label,indicator_grouping,indicator_unit,indicator_dp,filter_hint,filter_grouping_column +ind_one,Indicator,Indicator one,,,,, +filter_one,Filter,Filter one,,,,, +filter_two,Filter,Filter two,,,,,filter_one diff --git a/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy2.csv b/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy2.csv new file mode 100644 index 00000000000..53174a16549 --- /dev/null +++ b/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy2.csv @@ -0,0 +1,17 @@ +time_period,time_identifier,geographic_level,country_code,country_name,old_la_code,new_la_code,la_name,filter_one,filter_two,filter_three,ind_one +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,TwoOne,ThreeOne,1 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,TwoOne,ThreeOne,2 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneOne,TwoOne,ThreeTwo,3 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,TwoOne,ThreeTwo,4 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,TwoTwo,ThreeThree,5 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneOne,TwoTwo,ThreeThree,6 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,TwoTwo,ThreeFour,7 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,TwoTwo,ThreeFour,8 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneTwo,TwoThree,ThreeFive,9 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneTwo,TwoThree,ThreeFive,10 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneTwo,TwoThree,ThreeSix,11 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneTwo,TwoThree,ThreeSix,12 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneTwo,TwoFour,ThreeSeven,13 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneTwo,TwoFour,ThreeSeven,14 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneTwo,TwoFour,ThreeEight,15 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneTwo,TwoFour,ThreeEight,16 diff --git a/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy2.meta.csv b/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy2.meta.csv new file mode 100644 index 00000000000..8d656a54566 --- /dev/null +++ b/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy2.meta.csv @@ -0,0 +1,5 @@ +col_name,col_type,label,indicator_grouping,indicator_unit,indicator_dp,filter_hint,filter_grouping_column +ind_one,Indicator,Indicator one,,,,, +filter_one,Filter,Filter one,,,,, +filter_two,Filter,Filter two,,,,,filter_one +filter_three,Filter,Filter three,,,,,filter_two diff --git a/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy3.csv b/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy3.csv new file mode 100644 index 00000000000..f473ca9fdb2 --- /dev/null +++ b/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy3.csv @@ -0,0 +1,17 @@ +time_period,time_identifier,geographic_level,country_code,country_name,old_la_code,new_la_code,la_name,filter_one,filter_two,filter_three,other_filter_one,other_filter_two,ind_one +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,TwoOne,ThreeOne,OneOne,TwoOne,1 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,TwoOne,ThreeOne,OneOne,TwoTwo,2 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneOne,TwoOne,ThreeTwo,OneOne,TwoThree,3 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,TwoOne,ThreeTwo,OneTwo,TwoThree,4 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,TwoTwo,ThreeThree,OneTwo,TwoFour,5 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneOne,TwoTwo,ThreeThree,OneTwo,TwoFive,6 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,TwoTwo,ThreeFour,OneThree,TwoSix,7 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneOne,TwoTwo,ThreeFour,OneThree,TwoSix,8 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneTwo,TwoThree,ThreeFive,OneThree,TwoSeven,9 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneTwo,TwoThree,ThreeFive,OneFour,TwoEight,10 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneTwo,TwoThree,ThreeSix,OneFour,TwoNine,11 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneTwo,TwoThree,ThreeSix,OneFour,TwoNine,12 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneTwo,TwoFour,ThreeSeven,OneFive,TwoTen,13 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneTwo,TwoFour,ThreeSeven,OneFive,TwoEleven,14 +2018,Calendar year,Local authority,E92000001,England,330,E08000025,Birmingham,OneTwo,TwoFour,ThreeEight,OneFive,TwoTwelve,15 +2018,Calendar year,Local authority,E92000001,England,370,E08000016,Barnsley,OneTwo,TwoFour,ThreeEight,OneSix,TwoTwelve,16 diff --git a/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy3.meta.csv b/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy3.meta.csv new file mode 100644 index 00000000000..bc25785e670 --- /dev/null +++ b/tests/test-data/files/small-files/filter-hierarchies/filter_hierarchy3.meta.csv @@ -0,0 +1,7 @@ +col_name,col_type,label,indicator_grouping,indicator_unit,indicator_dp,filter_hint,filter_grouping_column +ind_one,Indicator,Indicator one,,,,, +filter_one,Filter,Filter one,,,,, +filter_two,Filter,Filter two,,,,,filter_one +filter_three,Filter,Filter three,,,,,filter_two +other_filter_one,Filter,Other filter one,,,,, +other_filter_two,Filter,Other filter two,,,,,other_filter_one