Skip to content

781: handle None from fullmatch reference regex - #782

Merged
lognaturel merged 1 commit into
XLSForm:masterfrom
lindsay-stevens:pyxform-781
Sep 17, 2025
Merged

781: handle None from fullmatch reference regex#782
lognaturel merged 1 commit into
XLSForm:masterfrom
lindsay-stevens:pyxform-781

Conversation

@lindsay-stevens

Copy link
Copy Markdown
Contributor

Closes #781

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

  • this code branch is for is_pyxform_reference but it didn't handle the case where there is no match (looks like reference but has other characters) - in which case the iteration over outer_matches would fail and throw an error like "None has no group"
  • added test coverage for relevant usages of is_pyxform_reference:
    • repeat_count, now with tests showing common usage pattern outcomes
    • seed param, which had alternate usages already (constant/single ref)

What are the regression risks?

Fixes a regression, and tries to avoid others of a similar nature by adding more tests.

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

No

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

- this code branch is for `is_pyxform_reference` but it didn't handle
  the case where there is no match - in which case the iteration over
  `outer_matches` would fail and throw an error like "None has no group"
- added test coverage for relevant usages of is_pyxform_reference:
  - repeat_count, now with tests showing common usage pattern outcomes
  - seed param, which had alternate usages already (constant/single ref)

@lognaturel lognaturel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread tests/test_repeat_count.py
@lognaturel
lognaturel merged commit 87588ba into XLSForm:master Sep 17, 2025
13 checks passed
@lindsay-stevens
lindsay-stevens deleted the pyxform-781 branch September 18, 2025 06:19
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.

Error when converting form with count-selected() in repeat_count

2 participants