Fixed can't evaluate field Name in type interface{} for databricks queries list

This commit is contained in:
Andrew Nester 2025-03-07 17:58:47 +01:00
parent 5948339f92
commit 8e5ef6f977
No known key found for this signature in database
GPG Key ID: 12BC628A44B7DA57
5 changed files with 66 additions and 1 deletions

View File

@ -3,6 +3,7 @@
## Release v0.243.1
### CLI
* Fixed "can't evaluate field Name in type interface{}" for "databricks queries list" command ([#2450](https://github.com/databricks/cli/pull/2450))
### Bundles

View File

@ -0,0 +1,5 @@
>>> [CLI] queries list
ID Name Author
[UUID] Example query 1 user@acme.com
[UUID] Example query 2 user@acme.com

View File

@ -0,0 +1 @@
trace $CLI queries list

View File

@ -0,0 +1,58 @@
[[Server]]
Pattern = "GET /api/2.0/sql/queries"
Response.Body = '''
{
"results": [
{
"description": "Example description",
"owner_user_name": "user@acme.com",
"tags": [
"Tag 1"
],
"display_name": "Example query 1",
"id": "ae25e731-92f2-4838-9fb2-1ca364320a3d",
"lifecycle_state": "ACTIVE",
"last_modifier_user_name": "user@acme.com",
"query_text": "SELECT 1",
"parameters": [
{
"name": "foo",
"text_value": {
"value": "bar"
},
"title": "foo"
}
],
"update_time": "2019-08-24T14:15:22Z",
"warehouse_id": "a7066a8ef796be84",
"run_as_mode": "OWNER",
"create_time": "2019-08-24T14:15:22Z"
},
{
"description": "Example description",
"owner_user_name": "user@acme.com",
"tags": [
"Tag 1"
],
"display_name": "Example query 2",
"id": "be25e731-92f2-4838-9fb2-1ca364320a3d",
"lifecycle_state": "ACTIVE",
"last_modifier_user_name": "user@acme.com",
"query_text": "SELECT 1",
"parameters": [
{
"name": "foo",
"text_value": {
"value": "bar"
},
"title": "foo"
}
],
"update_time": "2019-08-24T14:15:22Z",
"warehouse_id": "a7066a8ef796be84",
"run_as_mode": "OWNER",
"create_time": "2019-08-24T14:15:22Z"
}
]
}
'''

View File

@ -11,7 +11,7 @@ func listOverride(listCmd *cobra.Command, listReq *sql.ListQueriesRequest) {
listCmd.Annotations["headerTemplate"] = cmdio.Heredoc(`
{{header "ID"}} {{header "Name"}} {{header "Author"}}`)
listCmd.Annotations["template"] = cmdio.Heredoc(`
{{range .}}{{.Id|green}} {{.Name|cyan}} {{.User.Email|cyan}}
{{range .}}{{.Id|green}} {{.DisplayName|cyan}} {{.OwnerUserName|cyan}}
{{end}}`)
}