databricks-sdk-py
databricks-sdk-py copied to clipboard
[ISSUE] Calling .as_dict() after patching a group raises an error
Description Calling as_dict() after patching a group creates the following error message:
.0 = <list_iterator object at 0x105cb6230>
> if self.schemas: body['schemas'] = [v.value for v in self.schemas]
E AttributeError: 'str' object has no attribute 'value'
Reproduction
group = ws.groups.create(display_name=f'sdk-tst-2')
ws.groups.patch(
group.id,
operations=[
iam.Patch(
op=iam.PatchOp.ADD,
path="entitlements",
value=[iam.ComplexValue(value="databricks-sql-access").as_dict()],
)
],
schemas=[iam.PatchSchema.URN_IETF_PARAMS_SCIM_API_MESSAGES_2_0_PATCH_OP],
)
group.as_dict()
Thanks for reporting this. I suspect it still fails even if you don't call patch, since your patch call doesn't actually change the returned group.
possibly related to this: https://github.com/databricks/databricks-sdk-py/issues/449