How to get the statistical summary of a reaactive dataset

That reactive probably returns something that you may not expect.
For debugging you could add an observer that just prints object structure to console:

observe( str(ds()) )
output$sum <- renderTable({
      summary(ds())
})

table object from summary() may also not be best choice for tableOutput() / renderTable(), there are quite a few packages that provide summary statistics as data.frames / tibbles, e.g. skimr::skim() / skimr::skim_without_charts(), rstatix::get_summary_stats().