Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE] client.users.create error #574

Open
Katherin07 opened this issue Mar 5, 2024 · 1 comment
Open

[ISSUE] client.users.create error #574

Katherin07 opened this issue Mar 5, 2024 · 1 comment
Assignees

Comments

@Katherin07
Copy link

Description
When in a defined function and specific authentication method using WorkspaceClient, the function users.create, throws the error (UsersAPI.create() missing 1 required positional argument: 'id')

Reproduction
This is a example of the function:

from databricks.sdk import WorkspaceClient
w = WorkspaceClient()

def create_user_workspace(w, displayname, username):
    try:
        user = w.users.create(display_name=f'{displayname}', user_name=f'{username}')
        print(f"User {displayname}' / '{username}' created correctly.")
        return user
    except Exception as e:
        print(f"Error creating user: {e}")
        raise(e)

Expected behavior
The user should be created correctly.

Is it a regression?
Im using version of the SDK: databricks-sdk-0.20.0
It's curious that using the same code without the defined function works fine, as shown below:

from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
user = w.users.create(display_name='Name complete', user_name='test@hotmail.com')

However, within the defined function, it fails with the error "UsersAPI.create() missing 1 required positional argument: 'id'".

Debug Logs
UsersAPI.create() missing 1 required positional argument: 'id'

@mgyucht
Copy link
Contributor

mgyucht commented Mar 13, 2024

UsersAPI.create() doesn't have any required positional arguments, and id is optional.

Can you share the full script, where you call create_user_workspace()? Can you also share the exact exception and stack trace?

@mgyucht mgyucht self-assigned this Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants