Skip to content

817: Add configurability to range question type#832

Merged
lognaturel merged 6 commits intoXLSForm:masterfrom
lindsay-stevens:pyxform-817
Apr 3, 2026
Merged

817: Add configurability to range question type#832
lognaturel merged 6 commits intoXLSForm:masterfrom
lindsay-stevens:pyxform-817

Conversation

@lindsay-stevens
Copy link
Copy Markdown
Contributor

@lindsay-stevens lindsay-stevens commented Mar 24, 2026

Closes #817

  • initial implementation of checks
  • tidy up error messages
  • add tests for validations
  • add tests for output
  • remove or update older range tests
  • check for interactions/regressions/etc e.g. with settings etc

Why is this the best possible solution? Were any other approaches considered?

Follows the specification in the linked ticket, related spec ticket, and forum post.

I was not completely clear on the discussion around asc/desc range support but there is a test test_range_spec_patterns__ok to show these variants that pass without error, even though half of them would potentially produce an empty range.

What are the regression risks?

The parameters are validated more closely now so that could cause an error where there was none before, but the added errors are intended to be consistent with what Collect and/or Webforms support anyway.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

Yes, though there are already filed: getodk/docs#2031 getodk/xforms-spec#336

Before submitting this PR, please make sure you have:

  • included test cases for core behavior and edge cases in tests
  • run python -m unittest and verified all tests pass
  • run ruff format pyxform tests and ruff check pyxform tests to lint code
  • verified that any code or assets from external sources are properly credited in comments

@lindsay-stevens lindsay-stevens force-pushed the pyxform-817 branch 2 times, most recently from 2aadc2b to 0369cdb Compare March 31, 2026 10:21
@lognaturel lognaturel force-pushed the pyxform-817 branch 2 times, most recently from fbce18a to e88b469 Compare April 2, 2026 23:50
@lognaturel
Copy link
Copy Markdown
Contributor

Apologies for the messy force pushes. I keep running only one of the two classes in test_range locally and then discovering issues in the other suite! I think this accounts for everything I can think of.

@lognaturel lognaturel merged commit ba8817f into XLSForm:master Apr 3, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add configurability to range question type

2 participants