Skip to content

Commit 8efa39c

Browse files
authored
[DOCS] add update user to how-to guide (#5755)
# 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/)
1 parent 258ed82 commit 8efa39c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

argilla/docs/how_to_guides/user.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,25 @@ workspace = client.workspaces('my_workspace')
209209
removed_user = user.remove_from_workspace(workspace)
210210
```
211211

212+
## Update a user
213+
214+
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.
215+
216+
```python
217+
import argilla as rg
218+
219+
client = rg.Argilla(api_url="<api_url>", api_key="<api_key>")
220+
221+
user_to_update = client.users('my_username')
222+
223+
user.username = 'new_username'
224+
user.first_name = 'new_first_name'
225+
user.last_name = 'new_last_name'
226+
user.role = 'admin'
227+
228+
updated_user = user_to_update.update()
229+
```
230+
212231
## Delete a user
213232

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

0 commit comments

Comments
 (0)