You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
databricks warehouses set-workspace-warehouse-config fails when providing a JSON.
The error is enable_serverless_compute is required even though this is part of the JSON on the root.
Steps to reproduce the behavior
create JSON file sql-warehouse-global-settings.json with contents
Run databricks warehouses set-workspace-warehouse-config --json @./sql-warehouse-global-settings.json
See error
The same happens when:
Omitting enable_serverless_compute from the JSON
Adding an entry to enabled_warehouse_types with {"enabled":true, "warehouse_type":"SERVERLESS"}
Enabling serverless compute via the workspace settings in the databricks UI and retrying all of the above
Expected Behavior
To have set the warehouse configuration. Also according to the API documentation this is not part of the payload.
Actual Behavior
It appears the JSON is validated against something undocumented and causes an error.
Additionally, this is also not returned in the json when calling databricks warehouses get-workspace-warehouse-config.
OS and CLI version
OS: MacOS Sonoma 14.4.1
Databricks-CLI: v0.222.0
Is this a regression?
Did this work in a previous version of the CLI? If so, which versions did you try?
It is possible that this field hasn't been added to our API specs yet. I have flagged this with the relevant team.
In the mean time you can work around the issue by using the databricks api command and making a raw API call to /api/2.0/sql/config/warehouses with the same body.
This seems to be related to the issue in Go SDK when fales boolean values marked as omitempty are being dropped from request body as a result of unmarshalling
## Changes
Added JSON input validation for CLI commands. Now when invalid JSON
passed as a payload to CLI commands, CLI performs input normalisation
and detects if there are any mismatches such as incorrect types, unknown
fields and etc.
This diagnostic information is printed in standard error output and does
not block command execution, so the change is backward compatible.
Fixes#1769#1764#1625#1560
## Tests
Added unit tests
```
andrew.nester@HFW9Y94129 ~ % databricks jobs create --json '{"seeti}'
Error: error decoding JSON at (inline):1:2: unexpected EOF
andrew.nester@HFW9Y94129 ~ % databricks jobs create --json '{"seeti": true}'
Warning: unknown field: seeti
in (inline):1:9
Error: Job settings must be specified.
```
---------
Co-authored-by: Pieter Noordhuis <pieter.noordhuis@databricks.com>
Describe the issue
databricks warehouses set-workspace-warehouse-config
fails when providing a JSON.The error is
enable_serverless_compute is required
even though this is part of the JSON on the root.Steps to reproduce the behavior
sql-warehouse-global-settings.json
with contentsdatabricks warehouses set-workspace-warehouse-config --json @./sql-warehouse-global-settings.json
The same happens when:
enable_serverless_compute
from the JSONenabled_warehouse_types
with{"enabled":true, "warehouse_type":"SERVERLESS"}
Expected Behavior
To have set the warehouse configuration. Also according to the API documentation this is not part of the payload.
Actual Behavior
It appears the JSON is validated against something undocumented and causes an error.
Additionally, this is also not returned in the json when calling
databricks warehouses get-workspace-warehouse-config
.OS and CLI version
OS: MacOS Sonoma 14.4.1
Databricks-CLI: v0.222.0
Is this a regression?
Did this work in a previous version of the CLI? If so, which versions did you try?
Debug Logs
The text was updated successfully, but these errors were encountered: