Skip to content

Commit b195ea4

Browse files
committed
Fix SDMX tests
1 parent 03cde36 commit b195ea4

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

vtl-sdmx/src/test/java/fr/insee/vtl/SDMXVTLWorkflowTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ void testGetEmptyDataset() {
8484
new Structured.DataStructure(Java8Helpers.listOf(
8585
new Structured.Component("facility_type", String.class, Dataset.Role.IDENTIFIER),
8686
new Structured.Component("municipality", String.class, Dataset.Role.IDENTIFIER),
87-
new Structured.Component("year", String.class, Dataset.Role.IDENTIFIER),
87+
new Structured.Component("TIME_PERIOD", String.class, Dataset.Role.IDENTIFIER),
8888
new Structured.Component("nb", Long.class, Dataset.Role.MEASURE)
8989
))
9090
);
9191
assertThat(result.get("BPE_NUTS3").getDataStructure()).isEqualTo(
9292
new Structured.DataStructure(Java8Helpers.listOf(
93-
new Structured.Component("year", String.class, Dataset.Role.IDENTIFIER),
93+
new Structured.Component("TIME_PERIOD", String.class, Dataset.Role.IDENTIFIER),
9494
new Structured.Component("facility_type", String.class, Dataset.Role.IDENTIFIER),
9595
new Structured.Component("nuts3", String.class, Dataset.Role.IDENTIFIER),
9696
new Structured.Component("nb", Long.class, Dataset.Role.MEASURE)
@@ -126,24 +126,24 @@ public void testGetTransformationsVTL() {
126126
" [rename ID_EQUIPEMENT to id, TYPEQU to facility_type, DEPCOM to municipality, REF_YEAR to year];\n" +
127127
"\n" +
128128
"// BPE aggregation by municipality, type and year\n" +
129-
"BPE_MUNICIPALITY <- BPE_DETAIL_CLEAN [aggr nb := count(id) group by municipality, year, facility_type];\n" +
129+
"BPE_MUNICIPALITY <- BPE_DETAIL_CLEAN [aggr nb := count(id) group by municipality, year, facility_type] [rename year to TIME_PERIOD];\n" +
130130
"\n" +
131131
"// BPE aggregation by NUTS 3, type and year\n" +
132132
"BPE_NUTS3 <- BPE_MUNICIPALITY [calc nuts3 := if substr(municipality,1,2) = \"97\" then substr(municipality,1,3) else substr(municipality,1,2)]\n" +
133-
" [aggr nb := count(nb) group by year, nuts3, facility_type];\n" +
133+
" [aggr nb := count(nb) group by TIME_PERIOD, nuts3, facility_type];\n" +
134134
"\n" +
135135
"// BPE validation of facility types by NUTS 3\n" +
136136
"CHECK_NUTS3_TYPES := check_datapoint(BPE_NUTS3, NUTS3_TYPES invalid);\n" +
137137
"\n" +
138138
"// Prepare 2021 census dataset by NUTS 3\n" +
139-
"CENSUS_NUTS3_2021 := LEGAL_POP [rename REF_AREA to nuts3, TIME_PERIOD to year, POP_TOT to pop]\n" +
140-
" [filter year = \"2021\"]\n" +
139+
"CENSUS_NUTS3_2021 := LEGAL_POP [rename REF_AREA to nuts3, POP_TOT to pop]\n" +
140+
" [filter TIME_PERIOD = \"2021\"]\n" +
141141
" [calc pop := cast(pop, integer)]\n" +
142-
" [drop year, NB_COM, POP_MUNI];\n" +
142+
" [drop TIME_PERIOD, NB_COM, POP_MUNI];\n" +
143143
"\n" +
144144
"// Extract dataset on general practitioners from BPE by NUTS 3 in 2021\n" +
145-
"GENERAL_PRACT_NUTS3_2021 := BPE_NUTS3 [filter facility_type = \"D201\" and year = \"2021\"]\n" +
146-
" [drop facility_type, year];\n" +
145+
"GENERAL_PRACT_NUTS3_2021 := BPE_NUTS3 [filter facility_type = \"D201\" and TIME_PERIOD = \"2021\"]\n" +
146+
" [drop facility_type, TIME_PERIOD];\n" +
147147
"\n" +
148148
"// Merge practitioners and legal population datasets by NUTS 3 in 2021 and compute an indicator\n" +
149149
"BPE_CENSUS_NUTS3_2021 <- inner_join(GENERAL_PRACT_NUTS3_2021, CENSUS_NUTS3_2021)\n" +

0 commit comments

Comments
 (0)