Skip to content

Update mask cannot be supplied to Alerts v2 CLI #3271

@aaronsewall

Description

@aaronsewall

Describe the issue

Alerts v2 can't be updated via the CLI without update mask when using --json, but update mask is not a flag that can be set, and isn't supported as a body parameter (it's a query parameter).

Steps to reproduce the behavior

$ databricks alerts-v2 update-alert 752617873107880 --json '{"query_text":"select * from  trial_dev.databricks_python_project_dev.filtered_taxis"}'
Error: Field 'update_mask' is required to be truthy!

$ databricks alerts-v2 update-alert 752617873107880 --json '{"query_text":"select * from  trial_dev.databricks_python_project_dev.filtered_taxis", "update_mask":"query_text"}'
Warning: unknown field: update_mask
  at 
  in (inline):1:89

Error: Field 'update_mask' is required to be truthy!

The same behavior when using the API works fine.

$ curl -s -X PATCH -H 'Authorization: Bearer REDACTED' -H 'Content-Type: application/json' -d '{"query_text":"select * from  trial_dev.databricks_python_project_dev.filtered_taxis"}' 'https://cloud.databricks.com/api/2.0/alerts/752617873107880?update_mask=query_text'

And it works in the databricks cli API wrapper if you include the update_mask as a query parameter.

$ databricks api patch "/api/2.0/alerts/752617873107880?update_mask=query_text" --json '{"query_text":"select * from  trial_dev.databricks_python_project_dev.filtered_taxis"}'

Expected Behavior

Updates should work via the CLI and should not throw errors if you forget the update mask.

Actual Behavior

Update mask is either required to be truthy, or is an unknown field.

OS and CLI version

Ubuntu 24.04, Databricks CLI v0.260.0

Is this a regression?

I don't know

Debug Logs

See above

Metadata

Metadata

Assignees

Labels

BugSomething isn't workingCLICLI related issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions