databricks / databricks-sdk-go

Databricks SDK for Go
https://docs.databricks.com/dev-tools/sdk-go.html
Apache License 2.0
51 stars 42 forks source link

`GetByName` method does not work for Volumes #1039

Open shreyas-goenka opened 2 months ago

shreyas-goenka commented 2 months ago

Description The GetByName method calls ListVolumes which requires a catalog_name argument that's not provided by the implementation. So you end up with an error:

ListVolumes Missing required field: catalog_name

Reproduction Example to reproduce:

func TestFoo(t *testing.T) {
    w, err := databricks.NewWorkspaceClient()
    require.NoError(t, err)

    _, err = w.Volumes.GetByName(context.Background(), "main.test-schema-1.test-volume-1")
    require.NoError(t, err)
}

Is it a regression? The SDK version is v0.45.0. I don't think this is a regression.

shreyas-goenka commented 2 months ago

It seems like there's a ReadByName method, which does what you'd expected the GetByName method to do. Both claim to "Get the volume" and return the same object. It's not clear why both of them exist.