Skip to content
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .nextchanges/air/list-info-pane-experiment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Fix the `air list` info pane showing `N/A` for a run's Experiment and Accelerators; it now shows them as `air get` does. ([#7598](https://github.com/databricks/cli/pull/7598))
5 changes: 5 additions & 0 deletions cmd/air/list_detail.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ func runDetailText(ctx context.Context, w *databricks.WorkspaceClient, runID int
url := mlflowLogsURL(w.Config.Host, ids)
data.MLflowURL = &url
}
// Same as `air get`: the experiment and accelerators come from the run's
// ai_runtime_task; a sweep or GenAI compute run has none.
if findForEachTask(run) == nil && genAIComputeTask(run) == nil {
enrichFromAiRuntimeTask(run, &data)
}

var buf bytes.Buffer
renderRunText(ctx, &buf, w, run, &data, ids)
Expand Down
26 changes: 26 additions & 0 deletions cmd/air/list_detail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"testing"

"github.com/charmbracelet/lipgloss"
"github.com/charmbracelet/x/ansi"
"github.com/databricks/cli/libs/cmdio"
"github.com/databricks/databricks-sdk-go/service/jobs"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -145,3 +146,28 @@ func TestUnnamedOlderRetryLabelFitsTheListColumnAndIsWholeInTheInfoPane(t *testi
assert.Equal(t, mlflowColWidth, lipgloss.Width(rows[0].MLflowLabel))
assert.Contains(t, info, mlflowRunID+" (retry 0)")
}

func TestInfoPaneShowsExperimentAndAcceleratorsLikeAirGet(t *testing.T) {
// Given a finished run whose ai_runtime_task names its experiment and compute.
run := indexRun(7, 1000_000)
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/api/2.2/jobs/runs/get" {
_ = json.NewEncoder(w).Encode(run)
return
}
_, _ = w.Write([]byte(`{}`))
}))
t.Cleanup(srv.Close)
ctx := cmdio.MockDiscard(t.Context())
w := newTestWorkspaceClient(t, srv.URL)

// When the info pane renders the run.
info, err := runDetailText(ctx, w, 7)
require.NoError(t, err)

// Then it shows the experiment and accelerators that `air get` shows for the
// same run, instead of their "N/A" fallbacks.
plain := ansi.Strip(info)
assert.Contains(t, plain, "Experiment exp ")
assert.Contains(t, plain, "Accelerators 1x H100 ")
}
Loading