Skip to content
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

Small fix to DB_Column visualization #12245

Merged
merged 2 commits into from
Feb 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -268,24 +268,21 @@ make_json_for_value val level=0 = case val of
prepared = if row.table.column_count > 5 then truncated + ["… " + (row.table.column_count - 5).to_text+ " more"] else truncated
"Row{" + (prepared.join ", ") + "}"
table : Table ->
if level != 0 then "Table{" + table.row_count + " rows x " + table.column_count + " columns}" else
if level != 0 then "Table{" + table.row_count.to_text + " rows x " + table.column_count.to_text + " columns}" else
truncated = table.columns.take 5 . map _.name
prepared = if table.column_count > 5 then truncated + ["… " + (table.column_count - 5).to_text+ " more"] else truncated
"Table{" + table.row_count.to_text + " rows x [" + (prepared.join ", ") + "]}"
col : Column ->
if level != 0 then "Column{" +col.name + ": " + col.row_count + " rows}" else
if level != 0 then "Column{" +col.name + ": " + col.row_count.to_text + " rows}" else
items = make_json_for_value col.to_vector level
"Column{" + col.name + ": " + items + "}"
table : DB_Table ->
if level != 0 then "Table{" + table.row_count + " rows x " + table.column_count + " columns}" else
if level != 0 then "DB_Table{" + table.column_count.to_text + " columns}" else
truncated = table.columns.take 5 . map _.name
prepared = if table.column_count > 5 then truncated + ["… " + (table.column_count - 5).to_text+ " more"] else truncated
"Table{" + table.row_count.to_text + " rows x [" + (prepared.join ", ") + "]}"
"DB_Table{" + table.row_count.to_text + " rows x [" + (prepared.join ", ") + "]}"
col : DB_Column ->
if level != 0 then "Column{" +col.name + ": " + col.row_count + " rows}" else
materialise = col.read (..First 5)
truncated = materialise . map k-> k.to_text + ": " + (make_json_for_value (col.get k) level+1).to_text
prepared = if col.length > 5 then truncated + ["… " + (col.length - 5).to_text+ " items"] else truncated
"Column{" + col.name + ": " + prepared + "}"
if level != 0 then "DB_Column{"+col.name+"}" else
"DB_Column{" + col.name + ": " + col.length.to_text + " rows}"
f : Function -> "[Function "+f.to_text+"]"
_ -> val.to_display_text
Loading