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

[ISSUE] serving_endpoints.patch bug

Open ppiotrow opened this issue 1 year ago • 3 comments

Description Please verify serving_endpoints.patch implementation. It's not consistent with reality. API contact has no root level tags property Screenshot 2024-02-08 at 17 01 43 But it's present in the actual response Screenshot 2024-02-08 at 17 03 07

File /local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.10/site-packages/databricks/sdk/service/serving.py:271, in EndpointTag.from_dict(cls, d)
    269 @classmethod
    270 def from_dict(cls, d: Dict[str, any]) -> 'EndpointTag':
--> 271     return cls(key=d.get('key', None), value=d.get('value', None))

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

Looks like the code should first retrieve "tags" from response

res = self._api.do('PATCH', f'/api/2.0/serving-endpoints/{name}/tags', body=body, headers=headers)
return [EndpointTag.from_dict(v) for v in res]

ppiotrow avatar Feb 08 '24 16:02 ppiotrow

Experiencing the same issue, the tags get applied correctly, but then the SDK fails with the above error.

moritzmeister avatar Sep 11 '24 13:09 moritzmeister

I'm also experiencing this issue.

robinkrueger-sf avatar Nov 08 '24 10:11 robinkrueger-sf