You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
The following example seems to have a bug/issue.
Reproduction
import time
from databricks.sdk import AccountClient
from databricks.sdk.service import iam
a = AccountClient()
user = a.users.create(display_name=f'sdk-{time.time_ns()}', user_name=f'sdk-{time.time_ns()}@example.com')
a.users.patch(id=user.id,
schemas=[iam.PatchSchema.URN_IETF_PARAMS_SCIM_API_MESSAGES_2_0_PATCH_OP],
operations=[
iam.Patch(op=iam.PatchOp.ADD,
value=iam.User(roles=[iam.ComplexValue(value="account_admin")]))
])
# cleanup
a.users.delete(id=user.id)
Expected behavior
To patch the user. Add the user to the specified role (account_admin).
Debug Logs
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type User is not JSON serializable
Other Information
OS: macOS
Version: databricks-sdk 0.6.0
Additional context
The following code works (adding the '.as_dict()' method to the 'iam.User' object):
import time
from databricks.sdk import AccountClient
from databricks.sdk.service import iam
a = AccountClient()
user = a.users.create(display_name=f'sdk-{time.time_ns()}', user_name=f'sdk-{time.time_ns()}@example.com')
a.users.patch(id=user.id,
schemas=[iam.PatchSchema.URN_IETF_PARAMS_SCIM_API_MESSAGES_2_0_PATCH_OP],
operations=[
iam.Patch(op=iam.PatchOp.ADD,
value=iam.User(roles=[iam.ComplexValue(value="account_admin")]).as_dict())
])
# cleanup
#a.users.delete(id=user.id)
The text was updated successfully, but these errors were encountered:
Description
The following example seems to have a bug/issue.
Reproduction
Expected behavior
To patch the user. Add the user to the specified role (account_admin).
Debug Logs
Other Information
Additional context
The following code works (adding the '.as_dict()' method to the 'iam.User' object):
The text was updated successfully, but these errors were encountered: