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

[BUGFIX] validate client credentials to make error messages clearer #5384

Merged
merged 6 commits into from
Aug 7, 2024

Conversation

burtenshaw
Copy link
Contributor

Description

This PR improves error messaging when users pass incorrect credentials to the Argilla client. It does these things:

  • adds a custom credentials exception
  • logs the user details when client is successfully inited
  • raise the custom exception when above fails

Closes #<issue_number>

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested

No new tests.

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

Copy link
Member

@davidberenstein1957 davidberenstein1957 left a comment

Choose a reason for hiding this comment

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

@burtenshaw, look good. We should update it in the changelog. Also, left one small comment.

argilla/src/argilla/_api/_client.py Outdated Show resolved Hide resolved
@burtenshaw burtenshaw changed the base branch from develop to releases/2.0.1 August 6, 2024 12:21
Copy link

codecov bot commented Aug 6, 2024

Codecov Report

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

Project coverage is 91.21%. Comparing base (8206d55) to head (703f184).
Report is 3 commits behind head on releases/2.0.1.

Files Patch % Lines
...lla-server/src/argilla_server/contexts/datasets.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           releases/2.0.1    #5384      +/-   ##
==================================================
+ Coverage           91.13%   91.21%   +0.08%     
==================================================
  Files                 139      139              
  Lines                5716     5746      +30     
==================================================
+ Hits                 5209     5241      +32     
+ Misses                507      505       -2     
Flag Coverage Δ
argilla-server 91.21% <99.53%> (+0.08%) ⬆️

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.

@burtenshaw burtenshaw changed the base branch from releases/2.0.1 to develop August 6, 2024 12:24
@burtenshaw burtenshaw merged commit c902c1e into develop Aug 7, 2024
12 checks passed
@burtenshaw burtenshaw deleted the bugfix/validate-client-credentials branch August 7, 2024 08:24
burtenshaw added a commit that referenced this pull request Aug 7, 2024
…5384)

# 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 improves error messaging when users pass incorrect credentials
to the `Argilla` client. It does these things:
- adds a custom credentials exception
- logs the user details when client is successfully inited
- raise the custom exception when above fails

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)


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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.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.

[BUG] Make client instantiantion fail if credentials are not correct with a clear message
2 participants