Add Pipelines Show Command - #6033
Conversation
Approval status: pending
|
f4c46a9 to
ef8b086
Compare
ef8b086 to
a77e404
Compare
|
|
||
| === json output | ||
|
|
||
| >>> [CLI] pipelines show main.default.people --output json |
There was a problem hiding this comment.
What happens if a user passes in a table name that already has backticks, like "main.default.people"?
There was a problem hiding this comment.
I assume the backticks are literal characters in the name (e.g. an MV whose catalog is named main). To address that correctly I double internal backticks, so such names are reachable.
if the user meant "main.default.people" and pre-quoted, they'll see a not-found error.
14eb197 to
e8ac2a9
Compare
| } | ||
|
|
||
| // fitColumns returns how many leading columns fit within width (<= 0 means unlimited) and whether any were dropped; at least one column is always shown. | ||
| func fitColumns(colWidth []int, width int) (shown int, cropped bool) { |
There was a problem hiding this comment.
Can you add acceptance tests which coveres this?
| } | ||
|
|
||
| // writes rows as an indented JSON array of column-ordered objects. | ||
| func renderJSON(w io.Writer, columns []string, rows [][]string) error { |
There was a problem hiding this comment.
Could you add an acceptance test for JSON output too?
| return nil | ||
| } | ||
|
|
||
| // renderTable writes a width-aware text table: cells cap at maxColumnWidth, and a positive width that the table exceeds drops trailing columns behind a "..." marker. |
There was a problem hiding this comment.
Do we really want to truncate? We don't really do this anywhere else, maybe bubbletea which we use underneath already handles this?
There was a problem hiding this comment.
I think truncation is in general smth we should do and especially relevant in this case bc this command shows a preview of a users dataset, which could have a lot of columns or cells with very long values Ex. blobs.
Both of these cases would break any non-truncated rendering we did and make the output really hard to read.
Also bubbletea just renders an inifinite scrollable view horizontally so it doesn't do any truncation but keeps the output format clean and lets the user scroll to see the rest of their columns (this also isn't great for large cell values like blobs bc it prints the whole blob so the user has to scroll horizontally past the whole thing).
44d2cde to
c8e4be9
Compare
|
An authorized user can trigger integration tests manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Changes
Adds
databricks pipelines show <catalog.schema.table>command: shows a table's columns and sample data (or--output json). RunsSELECT * FROM <table> LIMIT non a SQL warehouse. The warehouse is taken from--warehouse-id,DATABRICKS_WAREHOUSE_ID(env set), the workspace default, or picked.Also adds
renderStaticWithTruncationin tableview for detecting terminal width and rendering a formatted tableWhy
Users want a quick look at the data and schema of a dataset quickly without leaving the terminal. Mirrors the Catalog Explorer "Sample Data" experience for the CLI. Lives under the
pipelinescommand group.Tests
E2E testing:
Screen.Recording.2026-07-23.at.11.05.36.PM.mov