databricks-sdk-py icon indicating copy to clipboard operation
databricks-sdk-py copied to clipboard

[ISSUE] Missing required enable_serverless_compute parameter

Open DariaGarkusha opened this issue 2 years ago • 7 comments

Description When I call set_workspace_warehouse_config method from the WarehousesAPI, I get an exception databricks.sdk.core.DatabricksError: enable_serverless_compute is required. But this parameter is not available for the method.

Reproduction

from databricks.sdk import WorkspaceClient
from databricks.sdk.service.sql import SetWorkspaceWarehouseConfigRequestSecurityPolicy


client = WorkspaceClient()
warehouse_setting = client.warehouses.get_workspace_warehouse_config()
client.warehouses.set_workspace_warehouse_config(
    channel=warehouse_setting.channel,
    config_param=warehouse_setting.config_param,
    data_access_config=warehouse_setting.data_access_config,
    enabled_warehouse_types=warehouse_setting.enabled_warehouse_types,
    global_param=warehouse_setting.global_param,
    google_service_account=warehouse_setting.google_service_account,
    instance_profile_arn=warehouse_setting.instance_profile_arn,
    security_policy=SetWorkspaceWarehouseConfigRequestSecurityPolicy(warehouse_setting.security_policy.value),
    sql_configuration_parameters=warehouse_setting.sql_configuration_parameters,
)

Expected behavior Required parameter enable_serverless_compute should be an available argument of the set_workspace_warehouse_config method

Other Information

  • Version: 0.6.0

DariaGarkusha avatar Aug 21 '23 10:08 DariaGarkusha

Same issue:

image

williamdphillips avatar Sep 19 '23 15:09 williamdphillips

Disregard the commit - noticed this is auto-generated from the OpenAPI specs: "# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT."

The specs need to be updated to have this parameter until the requirement is removed.

williamdphillips avatar Sep 19 '23 16:09 williamdphillips

Thank you for filing this. I've reproduced this and have the following debug logs:

DEBUG:urllib3.connectionpool:https://<REDACTED>.cloud.databricks.com:443 "GET /api/2.0/sql/config/warehouses HTTP/1.1" 200 None
DEBUG:databricks.sdk:GET /api/2.0/sql/config/warehouses
< 200 OK
< {
<   "enable_serverless_compute": false,
<   "enabled_warehouse_types": [
<     {
<       "enabled": true,
<       "warehouse_type": "CLASSIC"
<     },
<     {
<       "enabled": true,
<       "warehouse_type": "PRO"
<     }
<   ],
<   "security_policy": "DATA_ACCESS_CONTROL"
< }
DEBUG:urllib3.connectionpool:https://<REDACTED>.cloud.databricks.com:443 "PUT /api/2.0/sql/config/warehouses HTTP/1.1" 400 None
DEBUG:databricks.sdk:PUT /api/2.0/sql/config/warehouses
> {
>   "enabled_warehouse_types": [
>     {
>       "enabled": true,
>       "warehouse_type": "CLASSIC"
>     },
>     {
>       "enabled": true,
>       "warehouse_type": "PRO"
>     }
>   ],
>   "security_policy": "DATA_ACCESS_CONTROL"
> }
< 400 Bad Request
< {
<   "error_code": "INVALID_PARAMETER_VALUE",
<   "message": "enable_serverless_compute is required."
< }

mgyucht avatar Sep 21 '23 07:09 mgyucht

After discussions with the team, it seems like this is an issue with the internal API specification of this endpoint. This parameter is required for customers who are able to use Serverless, but it is not included in our public API definition. We are currently discussing whether to expose this parameter in the API definition or make it optional. cc @mehmetcankurt @mengqiu-teng

mgyucht avatar Sep 22 '23 09:09 mgyucht

I still receive this DatabricksError in version 0.11.0. What is the current expected time for a solution and/or is there a possible workaround?

joostmelchers avatar Oct 20 '23 13:10 joostmelchers

Is there a workaround?

dipankarkush-db avatar Nov 01 '23 14:11 dipankarkush-db

Does the parameter actually do anything? What does it mean to set the enable_serverless_compute on the workspace wide warehouse configuration?

UPDATE: If you set it to "false" the following appears in the workspace SQL warehouse configuration in the UI:

Screenshot 2024-10-11 at 16 12 42

JCZuurmond avatar Oct 11 '24 14:10 JCZuurmond