Fix failing tests in PdfReader, OWImportDocuments, and OWCorpusViewer#1139
Merged
Conversation
52633f3 to
768f00e
Compare
ajdapretnar
reviewed
Aug 13, 2025
| def on_done(self, res: int): | ||
| """When matches count is done show the result in the label""" | ||
| self.n_matches = f"{int(res):,}" if res is not None else "n/a" | ||
| self.n_matches = int(res) if res is not None else "n/a" |
Collaborator
There was a problem hiding this comment.
Here, we wanted to have a separator. Please fix the failing test instead so that it check a string.
ajdapretnar
reviewed
Aug 13, 2025
| ) | ||
| if errors: | ||
| self.Warning.read_error("One file" if len(errors) == 1 | ||
| else f"{len(errors)} files") |
Collaborator
There was a problem hiding this comment.
Why is this check better than the above?
ajdapretnar
reviewed
Aug 13, 2025
| else f"{len(errors)} files") | ||
| if self.corpus: | ||
| self.n_text_data = len(self.corpus) | ||
| self.n_text_categories = 0 |
Collaborator
There was a problem hiding this comment.
Is this not already set in line 663:665?
ajdapretnar
reviewed
Aug 13, 2025
| self.n_text_data = len(self.corpus) | ||
| self.n_text_categories = 0 | ||
| else: | ||
| self.Warning.read_error.clear() |
Collaborator
There was a problem hiding this comment.
Errors don't have to be cleared if they are not raised. They are cleared on every new run, right?
04e225f to
94f2e16
Compare
94f2e16 to
5045ac6
Compare
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.
Issue
Tests were failing in:
TestPdfReader.test_errorTestOWImportDocuments(warning text, skipped documents count)TestOWCorpusViewer.test_search(n_matches type mismatch)Description of changes
PdfReaderto returnNonefor corrupted/empty PDFs.OWImportDocumentswarning message and skipped documents handling.OWCorpusViewer.n_matchesis stored as an integer for valid regex results.Includes