Unclear error messages when uploading csv file with data and/or metadata
When some columns are missing in the csv upload file, unclear error messages are returned. Whenever it is technically possible, we should provide more meaningful information to the end-user, even if the message is generic.
1. The data upload behavior described and corrected in #175 (closed) appeared again when uploading the csv file: QNA_METADATA_V8_08.11.csv
The error message returned is again as follows:
FREQ,REF_AREA,COUNTERPART_AREA,REF_SECTOR,COUNTERPART_SECTOR,MEASURE,ACTIVITY,INSTR_ASSET,EXPENDITURE,UNIT_MEASURE,PRICE_BASE,ADJUSTMENT,TRANSFORMATION,TABLE_IDENTIFIER,TIME_PERIOD - 1302
Instead, the expected error message is:
At row [..], the column header row, at least one of the dimension columns is missing. Make sure that all the dimension columns are present when importing values at observation level: FREQ,REF_AREA,COUNTERPART_AREA,REF_SECTOR,COUNTERPART_SECTOR,MEASURE,ACTIVITY,INSTR_ASSET,EXPENDITURE,UNIT_MEASURE,PRICE_BASE,ADJUSTMENT,TRANSFORMATION,TABLE_IDENTIFIER,TIME_PERIOD. Correct the import file and resubmit the request.
Note that ticket #175 (closed) implemented the usage of the localised key CsvMissingDimensions
, but it's usage got lost.
2. Data file upload containing also metadata columns fails with an unclear error mentioning metadata attribute. In the previous file the list of dimension columns was changed to correct (STO->MEASURE, PRICE->PRICE_BASE, added COUNTERPART_SECTOR) but also kept columns for attributes, metadata attributes and OBS_VALUE: QNA_METADATA_V8_08.11_DATA_SOURCE.csv
The upload is accepted, but then incorrect error is returned (Note: DATA_SOURCE here is part of the MSD):
The given key 'DATA_SOURCE' was not present in the dictionary.
Instead, the expected error message is:
The 'DATA_SOURCE' component is not part of the data structure definition and must not be included in the data upload file. Note that data and referential metadata cannot be uploaded together (at the same time), but require separate imports. Correct the file and resubmit the request.
Related files
- Structures: OECD.SDD.NAD-DSD_QNA_DF_QNA-1.0-all__1_.xml
- Data (not required to upload): OECD.SDD.NAD-DSD_QNA_DF_QNA-1.0-data__1_.csv