Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve order of columns when building secondary instance #602

Closed
lognaturel opened this issue Apr 4, 2022 · 0 comments · Fixed by #672
Closed

Preserve order of columns when building secondary instance #602

lognaturel opened this issue Apr 4, 2022 · 0 comments · Fixed by #672
Labels
Milestone

Comments

@lognaturel
Copy link
Contributor

Software and hardware versions

pyxform v1.9.0 and prior

Problem description

Columns are alphabetized by header name when a secondary instance is built. This hasn't been noticeable since secondary instances haven't been exposed anywhere without each value being pulled out explicitly. The new map appearance on select_ones shows additional properties in order from the XForm and it would be ideal for that order to reflect user intent.

Steps to reproduce the problem

Convert a form with a select that becomes a secondary instance (e.g. this one). Notice that in the XForm, node names are ordered alphabetically.

Expected behavior

The order of columns is preserved.

Other information

Tangentially related to #590

@lognaturel lognaturel added this to the Next milestone Apr 5, 2022
lindsay-stevens added a commit to lindsay-stevens/pyxform that referenced this issue Nov 30, 2023
…rm#602)

- found this issue because `error__contains` is the correct spelling, so
  the message was not being checked (the pyxformtestcase kwarg
  validation does not occur if the form has errors).
- the error for the entities sheet should report the problematic columns
  in the order they appear. Until XLSForm#602 is merged, the incoming dict
  may have random key order. This change avoids re-introducing the same
  sort of issue via set usage, instead doing the same with dict keys.
- to avoid tests randomly failing, test `error__contains` looks for
  each column individually.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants