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

[FEATURE]: Adding Functionality To Update Users #5615

Conversation

sean-hickey-wf
Copy link
Contributor

Description

Argilla offers the ability to create and delete users but not the ability to update a User object after it has been created. For example, if we want to update the Role of a user after they have been created (from annotator to admin for example), this is not possible without deleting and recreating the User.

This PR adds an update endpoint to the FastAPI server and also the convenience of doing this through the python sdk also
Closes #<issue_number>

Type of change

  • New feature (non-breaking change which adds functionality)
  • Improvement (change adding some improvement to an existing functionality)

How Has This Been Tested
Tests have been added at both the server and SDK level to ensure that the update method is working as expected

Checklist

  • 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/)

@sean-hickey-wf sean-hickey-wf marked this pull request as ready for review October 19, 2024 00:04
@sean-hickey-wf sean-hickey-wf marked this pull request as draft October 19, 2024 00:05
@sean-hickey-wf sean-hickey-wf marked this pull request as ready for review October 19, 2024 17:25
@sean-hickey-wf sean-hickey-wf changed the title Adding Functionality To Update Users [FEATURE]: Adding Functionality To Update Users Oct 21, 2024
Copy link
Member

@frascuchon frascuchon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks @sean-hickey-wf !!!

Could you please update the image used in the SDK integration tests to run them with the new changes?

      argilla-server:
        image: argilladev/argilla-hf-spaces:pr-5615

Copy link
Member

@jfcalvo jfcalvo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sean-hickey-wf thank you very much for your contribution ❤️ . I have added some small comments in case you want to apply them.

argilla-server/src/argilla_server/api/schemas/v1/users.py Outdated Show resolved Hide resolved
argilla-server/src/argilla_server/api/schemas/v1/users.py Outdated Show resolved Hide resolved
argilla-server/src/argilla_server/contexts/accounts.py Outdated Show resolved Hide resolved
@sean-hickey-wf
Copy link
Contributor Author

@frascuchon @jfcalvo thanks for the review! Will make those changes tonight or tomorrow 😄
If you think of anything else in the meantime lemme know!

@frascuchon
Copy link
Member

@sean-hickey-wf, let me know if you need help with this PR

@sean-hickey-wf
Copy link
Contributor Author

@sean-hickey-wf, let me know if you need help with this PR

@frascuchon @jfcalvo sorry this took so long, was swamped in work! I've made the changes requested but I having trouble getting the env set up to make sure the tests are passing. If one of ye could just check that everything looks sensible and make sure the tests pass we should be good to go!

Copy link
Member

@frascuchon frascuchon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some suggestions. I think those are the reasons why tests are failing.

@sean-hickey-wf
Copy link
Contributor Author

I left some suggestions. I think those are the reasons why tests are failing.

@frascuchon sorry I meant to come back to this and fix it this week! Thanks for pushing those changes. Patches make more sense than Puts 👍

@frascuchon frascuchon added this to the v2.6.0 milestone Nov 28, 2024
Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 96.87500% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.98%. Comparing base (90f3c85) to head (90303da).

Files with missing lines Patch % Lines
...lla-server/src/argilla_server/contexts/accounts.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5615      +/-   ##
===========================================
+ Coverage    91.95%   91.98%   +0.03%     
===========================================
  Files          161      161              
  Lines         6750     6776      +26     
===========================================
+ Hits          6207     6233      +26     
  Misses         543      543              
Flag Coverage Δ
argilla-server 91.98% <96.87%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

argilla-server/CHANGELOG.md Outdated Show resolved Hide resolved
argilla-server/src/argilla_server/api/handlers/v1/users.py Outdated Show resolved Hide resolved
argilla-server/src/argilla_server/api/schemas/v1/users.py Outdated Show resolved Hide resolved
argilla-server/src/argilla_server/contexts/accounts.py Outdated Show resolved Hide resolved
Copy link
Member

@jfcalvo jfcalvo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing contribution! 💪

Thank you very much.

@sean-hickey-wf
Copy link
Contributor Author

@jfcalvo @frascuchon thank you for helping finish this off!

@frascuchon frascuchon self-requested a review December 3, 2024 08:28
Copy link
Member

@frascuchon frascuchon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this great contribution, @sean-hickey-wf!

@frascuchon frascuchon merged commit 62a1fd0 into argilla-io:develop Dec 3, 2024
1 check passed
frascuchon added a commit that referenced this pull request Dec 10, 2024
# 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. -->

This PR resolves some errors found after changes included in #5615.

**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)


**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/)
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

Successfully merging this pull request may close these issues.

3 participants