-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added better display of NULL values in FilterableTable (as in SQL Lab Results) #8003
Added better display of NULL values in FilterableTable (as in SQL Lab Results) #8003
Conversation
…as in SQL Lab results) and changed sorting order so that NULL values always come last
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! a couple comments here
superset/assets/src/components/FilterableTable/FilterableTable.jsx
Outdated
Show resolved
Hide resolved
superset/assets/src/components/FilterableTable/FilterableTable.jsx
Outdated
Show resolved
Hide resolved
superset/assets/src/components/FilterableTable/FilterableTableStyles.css
Outdated
Show resolved
Hide resolved
Thanks for your review @etr2460 , your recommendations were implemented |
Nice @semantiDan ! Just one observation regarding ordering of nulls; traditionally in SQL, nulls are placed first when ascending and last when descending. Showing nulls last on ascending order, a person used to regular SQL might erroneously believe that there aren't any nulls if the nulls are not on screen. Is there some specific reason why nulls shouldn't be shown first on ascending order? |
Thanks @villebro , You can still specify in your SQL query the order you wish to see the nulls, i.e.
or
From my personal experience, when interacting with the UI and I'm doing data exploration, I care more about the values than the NULLS. So when I'm looking at a very large table with many columns, although my initial query had a particular order in mind, I still might want to explore the largest or smallest values for other different columns. I wonder, what would be the exploratory value for seeing NULL values first? |
Wow, I had no idea null sorting was this non-standardized! Personally I sometimes instinctively click the sort order twice to check if there are nulls present. Having them systematically last feels slightly biased, as they would never show up on top of the list irrespective of the ordering. Would be interested in hearing other people's thoughts on this. At any rate the proposed ordering is much better than the current (mis)behaviour, so if nobody else feels strongly about null ordering I'm perfectly fine with this approach. |
superset/assets/src/components/FilterableTable/FilterableTableStyles.css
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #8003 +/- ##
==========================================
- Coverage 73.23% 65.58% -7.65%
==========================================
Files 115 469 +354
Lines 11839 22437 +10598
Branches 0 2438 +2438
==========================================
+ Hits 8670 14716 +6046
- Misses 3169 7601 +4432
- Partials 0 120 +120
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! thanks for the contribution
Enhancement (new features, refinement)
Choose one
SUMMARY
While working with a large, non-curated and diverse database consisting of many columns and rows per table I found myself painfully trying to distinguish null values from actual strings/numbers.
Whatsmore, by sorting columns that were supposed to be numerical, the null values sometimes took precedence over the order when I was trying to sort said columns.
More information can be found in Issue #7983 (Better Visualization and Sorting for NULL values)
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before change when sorting by ascending order for totaltracks column:
Before change when sorting by descending order for totaltracks column:
After change when sorting by ascending order for totaltracks column:
After change when sorting by descending order for totaltracks column:
TEST PLAN
Run any query in SQL lab in which the results contain NULL values and sort the column.
ADDITIONAL INFORMATION