XLSForm / pyxform

A Python package to create XForms for ODK Collect.
BSD 2-Clause "Simplified" License
77 stars 134 forks source link

Survey, Choices, Settings should not be case sensistive #572

Open yanokwa opened 2 years ago

yanokwa commented 2 years ago

If you have workbook with Survey or Choices rather than survey and choices, XLSForm reports "Error: The survey sheet is either empty or missing important column headers. I think we these sheet names should be case-insensitive. I thought from #141 addressed it, but using the attached case.xlsx in pyxform 1.7.0 fails.

lindsay-stevens commented 2 years ago

I can reproduce this with the example file. A quick fix would be to change xls2json_backends.py to:

if sheet.name.lower() not in constants.SUPPORTED_SHEET_NAMES:

The test for this in test_sheet_columns.py is fine. Unfortunately since it is a PyxformXform test it bypasses the raw XLS processing step in xls2json_backends.py where the problem arises. A fix should include an end-to-end test with the sample XLSX file to ensure test coverage.