positron icon indicating copy to clipboard operation
positron copied to clipboard

Data Explorer: invalid regex throws error in console

Open jthomasmock opened this issue 1 year ago • 0 comments

System details:

Positron and OS details: Positron Version: 2024.08.0 (Universal) build 24

Code - OSS Version: 1.91.0 Commit: d1012cc6f36088bac24a16dcfd1b55d026b239c1 Date: 2024-08-09T04:20:57.440Z Electron: 29.4.0 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Darwin arm64 23.5.0

Interpreter details:

R 4.4

Describe the issue:

Exposing internal errors via console after running another command

Steps to reproduce the issue:

R script:

View(data.frame(string = c("catfish", "cattails", "dogwood", "catapult")))
  1. Read that dataframe into Data Explorer.
  2. Try to apply a "does not contain 'cat'" regex ^(?!.*x).*
  3. Note the error in the filter since it's not valid for R.

image

  1. Apply a R compliant regex for the same thing ^[^x]*$ - note that it filters all of the values except dogwood.
  2. Run any command in R console (head(mtcars)).
  3. Note the error in the console
Warning message:
In grepl(pattern = params$term, col, ignore.case = !params$case_sensitive) :
  TRE pattern compilation error 'Invalid regexp'

Expected or desired behavior:

An invalid regex shouldn't be exposed via console.

Were there any error messages in the UI, Output panel, or Developer Tools console?

jthomasmock avatar Aug 19 '24 14:08 jthomasmock