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

`workload_size` should expect a `str`, not an object which references `value`

Open jbrill opened this issue 1 year ago • 1 comments

https://github.com/databricks/databricks-sdk-py/blame/193c3fbc255262de506b9bb927c87392c2c26720/databricks/sdk/service/serving.py#L1654

When attempting to call with an example:

ServedModelInput(
            model_name=model_name,
            model_version=latest_model_version,
            workload_size="Small",
            scale_to_zero_enabled=True,
            environment_vars={}
        )

We receive:

   1652 if self.name is not None: body['name'] = self.name
   1653 if self.scale_to_zero_enabled is not None: body['scale_to_zero_enabled'] = self.scale_to_zero_enabled
-> 1654 if self.workload_size is not None: body['workload_size'] = self.workload_size.value
   1655 if self.workload_type is not None: body['workload_type'] = self.workload_type.value
   1656 return body

AttributeError: 'str' object has no attribute 'value'

jbrill avatar Jan 03 '24 16:01 jbrill

@jbrill can you use ServedModelInputWorkloadSize.SMALL for now?

We plan to make the SDK accept strings for enum values in the coming future.

mgyucht avatar Jan 03 '24 16:01 mgyucht