Repository navigation
BUG: Make ExtensibleUWSElement true when it has child elements - #789
Merged
bsipocz merged 3 commits intoOct 15, 2026
Merged
Conversation
- bool(job.jobinfo) depended on the text astropy reports at the jobInfo end tag, which was the text of the last nested element - astropy/astropy#20509 stops repeating that text, so a jobInfo holding only child elements became false and `if job.jobinfo:` skipped it - Add __bool__, true when the element has child elements or text - Add tests for a jobInfo with only child elements and an empty jobInfo
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #789 +/- ##
==========================================
+ Coverage 80.60% 80.61% +0.01%
==========================================
Files 90 90
Lines 10366 10374 +8
==========================================
+ Hits 8355 8363 +8
Misses 2011 2011 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
bsipocz
approved these changes
Oct 14, 2026
bsipocz
left a comment
Member
There was a problem hiding this comment.
Thanks, it looks good, with a minor suggestion for the comment.
Co-authored-by: Brigitta Sipőcz <b.sipocz@gmail.com>
Contributor
Author
|
Updated! Thanks. |
Member
|
Thanks. I may or may not do a bugfix release before 1.10, I'll see more clearly about it by next week. |
Contributor
Author
|
No, worries. Thanks! Feel free to just migrate the changelog snippet to where it needs to go. |
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #788
ExtensibleUWSElement, which pyvo uses forjobInfoand everything inside it, got its truthiness fromContentMixin.__bool__. That only looks at the text astropy reports with the element's end tag. For an element that holds only child elements, that text was the last child's text, repeated by astropy's XML parser. But that was a bug in the astropy parser. astropy/astropy#20509 (milestoned for astropy 8.1) stops repeating it, so once merged,if job.jobinfo:would be false and would skip a populatedjobInfo, anddocs/io/uws.rstwould fail.This PR adds
ExtensibleUWSElement.__bool__, which is true when the element has child elements or text. It does not depend on the end-tag text, so it works with astropy main and with astropy/astropy#20509.Claude Opus was used to help diagnose and draft this fix.