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

[ISSUE] Calling .as_dict() after patching a group raises an error

Open william-conti opened this issue 2 years ago • 2 comments

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()

william-conti avatar Nov 02 '23 11:11 william-conti

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.

mgyucht avatar Nov 02 '23 12:11 mgyucht

possibly related to this: https://github.com/databricks/databricks-sdk-py/issues/449

grusin-db avatar Nov 20 '23 15:11 grusin-db