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

Catch SecretNotFoundError in google colab login #1912

Merged
merged 3 commits into from
Dec 15, 2023

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Dec 15, 2023

Google Colab introduced a new exception SecretNotFoundError that is raised when trying to access a secret that does not exist in the user vault. This PR adapts the Colab login integration to catch this error instead of relying on reading the error message itself.

I've also updated the warning messages to be displayed on multiple lines otherwise it results in one gigantic line that no-one will ever read ^^

@Wauplin Wauplin requested a review from LysandreJik December 15, 2023 08:45
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link

codecov bot commented Dec 15, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (2b95d2b) 82.25% compared to head (974b36e) 82.22%.
Report is 1 commits behind head on main.

Files Patch % Lines
src/huggingface_hub/_login.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1912      +/-   ##
==========================================
- Coverage   82.25%   82.22%   -0.03%     
==========================================
  Files          65       65              
  Lines        8029     8030       +1     
==========================================
- Hits         6604     6603       -1     
- Misses       1425     1427       +2     

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

Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

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

nice QoL improvement

Copy link
Contributor

@osanseviero osanseviero left a comment

Choose a reason for hiding this comment

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

Nice 🔥

@Wauplin
Copy link
Contributor Author

Wauplin commented Dec 15, 2023

Thanks for the review! Yes very nice QoL I think. Looking forward for releasing this! (early next week?)

@Wauplin Wauplin merged commit 8d917aa into main Dec 15, 2023
16 checks passed
@Wauplin Wauplin deleted the adapt-google-colab-secret-not-found branch December 15, 2023 10:44
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.

4 participants