Closed yulqen closed 4 years ago
New test required in test_datamap_parser.py
- stub created. Need to focus on engine.utils.extraction.datamap_reader()
which should reject any badly formatted datamap file. All exceptions raised here should be passed to main()
and handled with appropriate log messages.
Fixed by raising exception when sheet
field is missing, and datamaps quits, asking the user to correct the datamap.
If a sheet-block (however many rows pertaining to a particular sheet) of rows in the datamap has its sheet field missing/blank, then that row will now migrate during the
export
process, However, if the first row of the block is intact and the other sheet fields are missing for that particular block, then the data will actually be migrated.This will cause a problem if the gap in the sheet entries spans the boundaries between blocks because the program won't know where the change in sheet happens.
Example:
The code handling this is currently at
engine/repository/templates.py(39),
_populate_workbook(). The test is
test_populate_templates_from_master.py.test_export_continues_with_missing_sheet_in_datamap`.The best solution here is to use the initial datamap check to ensure that every datamap row has the requisite fields, and warn the user before it procedes.