Repository navigation
Conversation
|
E2E Tests 🚀 Why these tags?
More on automatic tags from changed files. Test count: Linux: 411 tests across 3 shards, Windows: 292 tests across 2 shards, Web: 331 tests across 2 shards. |
|
/explore drive this around a bit and see if you can find anything broken, awkward, or missing |
|
🔎 Exploratory testing dedea1c Focus: drive this around a bit and see if you can find anything broken, awkward, or missing 1 moderate · 1 minor |
|
From the moderate finding:
This is intentional; the code necessary to include the search would be prohibitively complicated since we match different values in different column types and would need to explicitly list each column and all of the matching we do, string conversion, etc. to get it to a state where we can apply the search. |
Addresses #3302
Summary
This PR adds a search box to the Data Explorer that filters the table to rows where any column matches the search term. It works with R and Python data frames, and with CSV, TSV, Parquet, and Excel files opened in the file viewer. Matching cells are highlighted, so you can see why a row is shown.
This is the Positron half of the feature. It includes the protocol, the frontend, the Python backend, and the DuckDB file viewer, and it bumps ark to pick up the R backend in posit-dev/ark#1463. See that PR for the R matching details.
How it works
The search is sent to the backend as a new row filter type,
global_search, that has no column. Because it goes through the existing row filter path, it stacks with column filters, is reflected in summary stats, and is re-applied when the data changes. The search always runs after the column filters, so it only looks at rows that passed them. The search is never included in Convert to Code.Matching rules
3matches3.7, and3.1matches3.14159but not3. Grouped commas (1,234), a leading dot (.5), and signs are accepted. Note that this behavior differs from RStudio, which treats numbers as text.NA,null, orNone.Handling numerics
RStudio's search basically converts every column to text and then searches the text, which I've always thought in retrospect was pretty dumb for numeric values; if you search for "5" you are probably not looking for "153". As noted above, we now match numbers with as much precision as you specify, so "5" finds all numbers that are 5. If you type a more specific number like 5.1, you get a more precise result.
Numbers still match inside text columns, so you can do numeric & text searches at the same time. This feature is designed to be more about low-friction, fast searching than designing a careful search.
Large tables
To keep a search from blocking the kernel for too long, R and Python only scan up to 10 million cells by default (the
dataExplorer.search.maxCellssetting). When a search hits the limit, the status bar says so and offers a Search All button. The DuckDB file viewer ignores the limit, since it searches off the extension host thread.UI
Compatibility
All new protocol fields are optional. The search box only appears when the backend lists
global_searchas a supported filter type, so older backends and other data sources (for example, the database connections and third-party kernels) are unaffected and do not show it. Backends that do not return per-cell matches fall back to highlighting done in the frontend.Release Notes
New Features
Bug Fixes
Validation Steps
@:data-explorer @:duck-db @:web @:win
New e2e tests are in
test/e2e/tests/data-explorer/data-explorer-search.test.ts.Python:
R:
alin the search box. Rows with "Alice" and "Carol" remain and the matching cells are highlighted.3, then3.1, and check that numeric precision works as described above.NA(orNonein Python) and check that rows with missing values are shown.