Why is this the best possible solution? Were any other approaches considered?
This adds to the existing entities validation in the parsing module. The approach is to create an enum with the allowed column names, and if any extra columns are found, raise an error naming the unexpected columns. I went through and updated internal string usages to reference the constants module to ensure that the keys are consistent (this typing could be done with a class but workbook_to_json emits a dict).
What are the regression risks?
Users may now get an error if they have already created forms where they have used annotation columns like those allowed in other XLSForm sheets. The Entities sheet is now "strict" in the sense that it only allows certain columns now.
Does this change require updates to documentation? If so, please file an issue here and include the link below.
Probably not, the documentation would already say which columns are required / allowed.
Before submitting this PR, please make sure you have:
[x] included test cases for core behavior and edge cases in tests
[x] run nosetests and verified all tests pass
[x] run black pyxform tests to format code
[x] verified that any code or assets from external sources are properly credited in comments
Closes #669
Why is this the best possible solution? Were any other approaches considered?
This adds to the existing entities validation in the parsing module. The approach is to create an enum with the allowed column names, and if any extra columns are found, raise an error naming the unexpected columns. I went through and updated internal string usages to reference the constants module to ensure that the keys are consistent (this typing could be done with a class but
workbook_to_json
emits a dict).What are the regression risks?
Users may now get an error if they have already created forms where they have used annotation columns like those allowed in other XLSForm sheets. The Entities sheet is now "strict" in the sense that it only allows certain columns now.
Does this change require updates to documentation? If so, please file an issue here and include the link below.
Probably not, the documentation would already say which columns are required / allowed.
Before submitting this PR, please make sure you have:
tests
nosetests
and verified all tests passblack pyxform tests
to format code