Bug description
When utilizing the search bar functionality within a table in GitHub, the total calculation feature fails to adjust accordingly. This means that when searching for specific values within the table, the total calculation displayed does not reflect the filtered results, leading to inaccuracies in data analysis and reporting.
How to reproduce the bug
- Go to a Table that has a
Search barandShow Totalsenabled - Populate the table
- Perform a search using the search bar for specific values within the table. I used a ticketID
- Observe that the table adjusts to show only the rows matching the search criteria.
- Check the "Show Total" calculation displayed at the bottom of the numerical column.
- Note that the total calculation does not adjust to reflect the filtered results; it continues to display the total for all values, including those not visible due to the search filter.
Screenshots/recordings
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
When I conduct cross filtering
, the Show Totals works
Checklist
- [X] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [X] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [X] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Comment From: rusackas
Ahh yes.. the crossfilter actually changes the data being fed to the table, so the total is calculated. The filter IN the table doesn't appear to recalculate on the fly. I'm sure it could if it had all the data, but if server pagination comes into play, that gets quite complicated.
Not sure if @justinpark 's planned migration to AG Grid would solve this.
Comment From: rusackas
This still seems to be the case, but the issue has gone silent for upward of a year. Anyone want to open a PR? If not, we may close this issue as stale in time.
Comment From: CoffeeWriter
Hi @rusackas
Just to confirm: is the previous "Show totals" option now represented by the "Show summary" row in the latest Table chart?
I tested this using the quick start setup with the latest official release (Superset 5.0.0). When using the Table chart with the "Summary" row enabled: - Applying a Search box filter updates the displayed rows, but the Summary total does not change. - Applying a native filter recalculates the Summary correctly.
So summary follows filters but not the search box. This also seems related to #35141, since both involve the search box not being applied consistently to other Table features (totals vs. export).
If this is not the intended behavior, we would be glad to contribute a fix for it.
Comment From: CoffeeWriter
@rusackas @msyavuz I received approval on Slack on Friday to work on this issue, and we’ve already started. Could you please assign it to us? Thank you!
Comment From: kmstr87
@msyavuz @rusackas I wanted to clear seomthing up. For the Summary Count, do we want to show the total summary of every row in the dataset, or just the total of fetched x amount of rows from the dataset when the user enables server pagination?
Ex: If the total row summary is 39k for every row in the dataset, and the user wants only 100 rows by pagination, should be still show the 39k if the search bar filter is unused, or should we only show the total of 100 rows?