redash
redash copied to clipboard
Make NULL values visible
What type of PR is this?
- [x] Feature
Description
Before this PR, on table visualization, NULL value is not visible but shown just as empty string(""). We cannot distinguish between empty string("") and NULL value on the table view.
This PR makes NULL values visible so that we can know the value is not empty string but NULL value. This is common behavior on many SQL tools.
How is this tested?
- [x] Manually
I run SQL query generate NULL values like below, and I confirmed that the data is shown as NULL.
select
1,
'aa',
null,
cast(null as int64),
cast(null as string),
cast(null as date),
cast(null as timestamp)
I really like this idea, but I bet we need to make this configurable (e.g. https://www.postgresql.org/docs/current/app-psql.html#APP-PSQL-META-COMMAND-PSET-NULL)
We could store this in organizations.settings
@eradman
Thank you for your comment !
But, I don't know any GUI / Web base tools that "NULL" text is configurable. (BigQuery / Snowflake / Looker Studio / phpMyAdmin / Sequel Ace / Athena / superset / metabase, etc... )
And so, I guess there is little demand to make NULL text configurable.
Also, I think it makes redash complex if we make every special value configurable, like emtpy string, NaN, Infinity, true, false ...
Also, for GUI tools, we can make many things configurable, like color, font, style configurable.
Do you think we should make these styles configurable ?
What I am anticipating is that some Redash users prefer the current handling of null values, and we will need a workaround.
There are already some settings that are not configurable from the Redash GUI, but can be changed. For example the default number format can be set:
UPDATE organizations
SET settings = jsonb_set(settings::jsonb, '{settings,float_format}', '"0.0"', true);
@eradman
What I am anticipating is that some Redash users prefer the current handling of null values, and we will need a workaround.
Thank you. I see ! So, I guess we can just have a option like 'visible_null_value' boolean value. How about ?
So, I guess we can just have a option like 'visible_null_value' boolean value
I had in mind a text value:
"null_value": "null"
This would be used by NullValueComponent()
So, I guess we can just have a option like 'visible_null_value' boolean value
I had in mind a text value:
"null_value": "null"This would be used by
NullValueComponent()
@eradman Thanks ! I'll implement like that !
@yoshiokatsuneo, after thinking about this further realized we need to get some feedback from other contributors--people are going to care about this and how it can be enabled/configured.
Please don't spend too much time on this, let's see if others will comment!
I would appreciate the ability to see nulls (distinctly from empty or blank strings). I don't feel strongly about how it's implemented, but I would prefer to be able to distinguish an actual null value from the string "null" or similar.
@jonahgreenthal
Thank you for your feedback ! In this PR, I changed the text color to gray, and the text style to italic for the NULL value so that we can distinguish "null" string from NULL value, like below. This is similar style as most other GUI / Web-based SQL tools. How about ?
Yep, that works for me. I saw you had done it, I just wanted to emphasize that I thought it was an important aspect, but I probably didn't communicate it very well.
@jonahgreenthal I see ! Thanks !
@eradman
Hello
let's see if others will comment!
I think we have waited for about 50 days, and no one care. Isn't it enough time ?
let's see if others will comment!
I think we have waited for about 50 days, and no one care. Isn't it enough time ?
I don't understand the question.
I'll take another look at this PR early next week.
@eradman
I don't understand the question.
Sorry, I mean, you have suggested that we should wait for comments for others, but I believe we have waited long enough.
I'll take another look at this PR early next week.
Thank you !
We need a way to configure the representation of NULL values. Attached is the start of the patch to make this happen null-value-diff.txt
@eradman
Thank you very much for the patch ! I applied the patch and adjusted the code.
https://github.com/getredash/redash/pull/7439/commits/56b64e4be6d9a242ed887bb3d49e50baa575772c