argilla icon indicating copy to clipboard operation
argilla copied to clipboard

docs: retrieve user by ID

Open datapumpernickel opened this issue 1 year ago • 6 comments

Description

Retrieving a user by ID works only when passing in an ID of class UUID. This has been updated in the docs, as well as in the function examples and one error message of the users.py functions.

Closes #5011

  • [x] Documentation update

How Has This Been Tested

Not tested yet.

Checklist

  • [x] I added relevant documentation
  • [ ] I followed the style guidelines of this project
  • [x] I did a self-review of my code
  • [x] I made corresponding changes to the documentation
  • [ ] My changes generate no new warnings
  • [ ] I filled out the contributor form (see text above)
  • [ ] I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/)

datapumpernickel avatar Jun 18 '24 09:06 datapumpernickel

Thanks @datapumpernickel, could you change the branch to main?

sdiazlor avatar Jun 19 '24 07:06 sdiazlor

@datapumpernickel, would you be able to change the code so we can obtain users either by str or UUID?

davidberenstein1957 avatar Jun 19 '24 07:06 davidberenstein1957

Woopsie, I was trying to change this to the main branch and did not see your reply @davidberenstein1957 in the meantime. Sorry about the mess. I could look at it, probably not this week, as I will be off until Mid-July. But then I can give it a try!

datapumpernickel avatar Jun 19 '24 07:06 datapumpernickel

Hi @datapumpernickel, no problem. Your contribution is great. I think it might be nicer for users to be able to pass either an id or UUID. @frascuchon @burtenshaw WDYT? Either way, Enjoy the holidays :)

davidberenstein1957 avatar Jun 19 '24 08:06 davidberenstein1957

Definitely more convenient to be able to pass both -thanks for the hint. It actually seemed pretty straight forward, to I just put in a commit with a small change that checks if the ID is of instance uuid.UUID, if not, it tries to convert it to an instance of uuid.UUID. It returns an error if that fails for some reason.

datapumpernickel avatar Jun 19 '24 08:06 datapumpernickel

@datapumpernickel , I realised this had become stale. Sorry for that. Would you be able to resolve the merge conflict? Also, I think the client.datasets and client.workspaces have similar methods that need to be tackled.

davidberenstein1957 avatar Oct 17 '24 07:10 davidberenstein1957

Hi @davidberenstein1957, sorry, I was not able to look at this in the past weeks. I just wanted to resolve the conflicts but upon testing it again, I realised that somehow this error has been patched:

This works now. 🎊 🚀

retrieved_user = client.users(id="0d05d426-294e-4524-b391-3d8db415537c")
retrieved_user

All the best for the upcoming release and thanks again!

datapumpernickel avatar Nov 03 '24 22:11 datapumpernickel

@datapumpernickel, no problem. Thanks for the effort. Hope to be able to follow up a bit better with your next PR. Take care :)

davidberenstein1957 avatar Nov 04 '24 10:11 davidberenstein1957