Update SQL Console IFrame

#13
by cfahlgren1 HF staff - opened

Hey, I love the use of the SQL Console, this should make it a little prettier with new embed, that way it only shows results and not sql :)

Let me know how things can be better :)

Here's what new embed looks like now:
image.png

Pendrokar changed pull request status to merged

@cfahlgren1 PR merged, I do want to ask one thing. Is it possible to hide null values? As they are currently hidden with whitespaces within the CSV/TSV file. A hacky way.

IF("col" IS NOT NULL, "col", '') for each selected column would have been an even more hacky way.

Hmm, I’m not sure if I am fully understanding. What do you mean by hiding null values?

image.png

For me I am seeing null values as empty cells. Do you want to see something else there?

@cfahlgren1 I mean this:
https://huggingface.co/datasets/Pendrokar/null_values

No value was added to col3, so it shows null. It used to be the same for all empty cells in the above tables. So I left a single whitespace in each cell.

ahh I see! Since every column is a string, we can just use COALESCE across all the columns. DuckDB makes this really easy with star expressions.

-- use column value or empty string for all columns in dataset
select COALESCE(columns(*), '') from train

You can see an example here and DuckDB Docs for it.

Sign up or log in to comment