Skip to content

Data viewer breaks when a numeric column's histogram computation fails #17990

Closed

Description

@kevinushey

When opening a data frame in the data viewer, RStudio computes a histogram for each numeric column (via hist() in .rs.describeCols(), SessionDataViewer.R) to power the column sparkline and brushing filter.

hist() can fail outright on some pathological numeric data (hist.default() has several stop() paths, e.g. "some 'x' not counted; maybe 'breaks' do not span range of 'x'"). The histogram branch only wraps the call in suppressWarnings(), which does not catch errors, so the error propagates and aborts the entire describe call -- rendering the whole data viewer unusable, not just the offending column.

Reported (without a reproducible example) at https://forum.posit.co/t/new-histograms-in-golden-wattle-data-viewer-break/212784

Fix: wrap the histogram computation in .rs.tryCatch() (as the sibling factor / character-summary branches already do) so a failure leaves that one column without a histogram instead of breaking the viewer.

Metadata

Metadata

Assignees

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions