Skip to content

Commit

Permalink
[DOCS] add update user to how-to guide (#5755)
Browse files Browse the repository at this point in the history
# Description
<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->

Closes #<issue_number>

**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- Refactor (change restructuring the codebase without changing
functionality)
- Improvement (change adding some improvement to an existing
functionality)
- Documentation update

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- I added relevant documentation
- I followed the style guidelines of this project
- I did a self-review of my code
- I made corresponding changes to the documentation
- I confirm My changes generate no new warnings
- I have added tests that prove my fix is effective or that my feature
works
- I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)
  • Loading branch information
sdiazlor authored Jan 20, 2025
1 parent 258ed82 commit 8efa39c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions argilla/docs/how_to_guides/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,25 @@ workspace = client.workspaces('my_workspace')
removed_user = user.remove_from_workspace(workspace)
```

## Update a user

You can update an existing user in Argilla by calling the `update` method on the `User` class. You can update the `username`, `first_name`, `last_name`, and `role` attributes.

```python
import argilla as rg

client = rg.Argilla(api_url="<api_url>", api_key="<api_key>")

user_to_update = client.users('my_username')

user.username = 'new_username'
user.first_name = 'new_first_name'
user.last_name = 'new_last_name'
user.role = 'admin'

updated_user = user_to_update.update()
```

## Delete a user

You can delete an existing user from Argilla by calling the `delete` method on the `User` class.
Expand Down

0 comments on commit 8efa39c

Please sign in to comment.