XLSForm / pyxform

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

Forms with a media column result in unhelpful error message. #601

Closed yanokwa closed 1 year ago

yanokwa commented 2 years ago

If you have a form with a media column (not media::image) and something in that column, pyxform gives a very unhelpful error.

Error: 'str' object has no attribute 'items'

See test.xlsx for an example.

It would be ideal if we warn that the column heading is likely to be incorrect. Maybe we build on the sheet name checking at #544?

lognaturel commented 1 year ago

media is not a known column name. It used to just be ignored like other unknown columns but since the translation checks were added, there's an assumption that media will be a dictionary.

I wanted to add a helpful error message but then I realized that we don't currently have an example of rejecting based on an issue in the header.

In the mean time, I propose restoring the prior behavior which is to ignore the unknown column name.

lognaturel commented 1 year ago

I think https://github.com/getodk/docs/issues/1546 will sufficiently address this.