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

[FIX] Corpus viewer: warn on bad regex #1095

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SanchoSamba
Copy link
Collaborator

Issue

Fixes #1068

Description of changes

Instead of crashing, a warning message is thrown on bad regex.

Includes
  • Code changes
  • Tests
  • Documentation

@@ -35,6 +36,8 @@
from orangecanvas.gui.utils import disconnected
from orangewidget.utils.listview import ListViewSearch

from PyQt5.QtWidgets import QMessageBox
Copy link
Member

Choose a reason for hiding this comment

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

Please delete this line (the correct import is already few lines up). We need to import from AnyQt so that the add-on is compatible both with Qt 5 and 6.

@markotoplak
Copy link
Member

Thanks for tackling this. I see two things that should be improved in this PR:

  1. The new error-showing functionality has to be tested, as in writing a unit test that verifies that the error is shown.
  2. The UX should be unified with how Orange usually does this. We tend to use widgets errors for stuff like this (see how read_file error works in owcorpus).

@markotoplak markotoplak changed the title Regex exception handling [FIX] Corpus viewer: warn on bad regex Jan 15, 2025
@ajdapretnar
Copy link
Collaborator

/rebase

1 similar comment
@ajdapretnar
Copy link
Collaborator

/rebase

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.

Corpus Viewer: Sanitize bad regex
3 participants