Skip to content

[ISSUE] JobsAPI.ListRuns and JobsAPI.ListRunsAll ignore the Limit parameter #1300

@marcocovaw

Description

@marcocovaw

Description
The WorkspaceClient.Jobs.ListRuns and WorkspaceClient.Jobs.ListRunsAll methods ignore the Limit request parameter.

Reproduction

package main

import (
  "context"
  "fmt"

  "github.com/databricks/databricks-sdk-go"
  "github.com/databricks/databricks-sdk-go/service/jobs"
)

func main() {
  w := databricks.Must(databricks.NewWorkspaceClient())
  all, err := w.Jobs.ListRunsAll(context.Background(), jobs.ListRunsRequest{
    Limit: 1,
  })
  if err != nil {
    panic(err);
  }
  if len(all) != 1 {
    fmt.Printf("Expected 1 run, got %d\n", len(all))
  }
}

Running this against a workspace with multiple job runs prints out something like Expected 1 run, got 206.

Expected behavior
The methods return up to the specified number of runs.

Is it a regression?
N/A

Debug Logs

2025/10/03 14:42:06 [TRACE] Loading config via environment
2025/10/03 14:42:06 [TRACE] Loading config via config-file
2025/10/03 14:42:06 [DEBUG] Loading ***.gcp.databricks.com profile from .databrickscfg
2025/10/03 14:42:06 [TRACE] Attempting to configure auth: "databricks-cli"
2025/10/03 14:42:06 [DEBUG] OAuth callback server listening on localhost:8020
2025/10/03 14:42:06 [DEBUG] OAuth callback server listening on localhost:8020
2025/10/03 14:42:07 [DEBUG] GET /api/2.2/jobs/runs/list?limit=1
... API response with 1 BaseRun object...
2025/10/03 14:42:07 [DEBUG] OAuth callback server listening on localhost:8020
2025/10/03 14:42:07 [DEBUG] GET /api/2.2/jobs/runs/list?limit=1&page_token=CAEQs_flypozIOjS6aT7-7sB
... API response with 1 BaseRun object...
...

Other Information

  • SDK Version: v0.85.0

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions