From b195ea45f44a3808f54c1b58a59a3606c8e0f5fd Mon Sep 17 00:00:00 2001 From: Nicolas Laval Date: Tue, 21 Jan 2025 15:13:30 +0100 Subject: [PATCH] Fix SDMX tests --- .../java/fr/insee/vtl/SDMXVTLWorkflowTest.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/vtl-sdmx/src/test/java/fr/insee/vtl/SDMXVTLWorkflowTest.java b/vtl-sdmx/src/test/java/fr/insee/vtl/SDMXVTLWorkflowTest.java index af3dcfdb..7b27c9a4 100644 --- a/vtl-sdmx/src/test/java/fr/insee/vtl/SDMXVTLWorkflowTest.java +++ b/vtl-sdmx/src/test/java/fr/insee/vtl/SDMXVTLWorkflowTest.java @@ -84,13 +84,13 @@ void testGetEmptyDataset() { new Structured.DataStructure(Java8Helpers.listOf( new Structured.Component("facility_type", String.class, Dataset.Role.IDENTIFIER), new Structured.Component("municipality", String.class, Dataset.Role.IDENTIFIER), - new Structured.Component("year", String.class, Dataset.Role.IDENTIFIER), + new Structured.Component("TIME_PERIOD", String.class, Dataset.Role.IDENTIFIER), new Structured.Component("nb", Long.class, Dataset.Role.MEASURE) )) ); assertThat(result.get("BPE_NUTS3").getDataStructure()).isEqualTo( new Structured.DataStructure(Java8Helpers.listOf( - new Structured.Component("year", String.class, Dataset.Role.IDENTIFIER), + new Structured.Component("TIME_PERIOD", String.class, Dataset.Role.IDENTIFIER), new Structured.Component("facility_type", String.class, Dataset.Role.IDENTIFIER), new Structured.Component("nuts3", String.class, Dataset.Role.IDENTIFIER), new Structured.Component("nb", Long.class, Dataset.Role.MEASURE) @@ -126,24 +126,24 @@ public void testGetTransformationsVTL() { " [rename ID_EQUIPEMENT to id, TYPEQU to facility_type, DEPCOM to municipality, REF_YEAR to year];\n" + "\n" + "// BPE aggregation by municipality, type and year\n" + - "BPE_MUNICIPALITY <- BPE_DETAIL_CLEAN [aggr nb := count(id) group by municipality, year, facility_type];\n" + + "BPE_MUNICIPALITY <- BPE_DETAIL_CLEAN [aggr nb := count(id) group by municipality, year, facility_type] [rename year to TIME_PERIOD];\n" + "\n" + "// BPE aggregation by NUTS 3, type and year\n" + "BPE_NUTS3 <- BPE_MUNICIPALITY [calc nuts3 := if substr(municipality,1,2) = \"97\" then substr(municipality,1,3) else substr(municipality,1,2)]\n" + - " [aggr nb := count(nb) group by year, nuts3, facility_type];\n" + + " [aggr nb := count(nb) group by TIME_PERIOD, nuts3, facility_type];\n" + "\n" + "// BPE validation of facility types by NUTS 3\n" + "CHECK_NUTS3_TYPES := check_datapoint(BPE_NUTS3, NUTS3_TYPES invalid);\n" + "\n" + "// Prepare 2021 census dataset by NUTS 3\n" + - "CENSUS_NUTS3_2021 := LEGAL_POP [rename REF_AREA to nuts3, TIME_PERIOD to year, POP_TOT to pop]\n" + - " [filter year = \"2021\"]\n" + + "CENSUS_NUTS3_2021 := LEGAL_POP [rename REF_AREA to nuts3, POP_TOT to pop]\n" + + " [filter TIME_PERIOD = \"2021\"]\n" + " [calc pop := cast(pop, integer)]\n" + - " [drop year, NB_COM, POP_MUNI];\n" + + " [drop TIME_PERIOD, NB_COM, POP_MUNI];\n" + "\n" + "// Extract dataset on general practitioners from BPE by NUTS 3 in 2021\n" + - "GENERAL_PRACT_NUTS3_2021 := BPE_NUTS3 [filter facility_type = \"D201\" and year = \"2021\"]\n" + - " [drop facility_type, year];\n" + + "GENERAL_PRACT_NUTS3_2021 := BPE_NUTS3 [filter facility_type = \"D201\" and TIME_PERIOD = \"2021\"]\n" + + " [drop facility_type, TIME_PERIOD];\n" + "\n" + "// Merge practitioners and legal population datasets by NUTS 3 in 2021 and compute an indicator\n" + "BPE_CENSUS_NUTS3_2021 <- inner_join(GENERAL_PRACT_NUTS3_2021, CENSUS_NUTS3_2021)\n" +