-
Notifications
You must be signed in to change notification settings - Fork 949
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
feat: pass a filename to oauth() #847
feat: pass a filename to oauth() #847
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for the pull request.
Please revert to the original formatting as it makes the review much easier.
@burnash Thanks for reviewing and sorry for the delay in replying. I've changed back the formatting, sorry about that and made some of the changes you requested. I'm not sure about this comment though: #847 (comment) And also, I wrote an answer to this one: #847 (comment) explaining the reason for my change. Let me know if there's anything else that needs to change. |
@burnash thanks for the additional pointers and good catches. I believe I've implemented the changes you requested. |
Hi @bastienboutonnet I checked your PR, looks good to me ! 👍 Could you please squash your commits in order to have only a single commit that introduces the feature ? If you don't feel confident with this kind of git tricks tell me I'll guide you through it. Then we could merge this relevant feature into master branch 😉 |
Add example usage in docstring Update user doc and correct inaccuracy revert formatting changes from black rephrase docstring for authorized_user file rename credentials_filename to authorized_user_filename revert doc change rename new parameter in doc and docstsings.
f8b7760
to
bbf780d
Compare
Hi @lavigne958 thanks a lot for your review, I've just squashed so feel free to merge. Thanks for asking. I generally just squash and merge contributor's branches on my OS project but this is a nice touch :) |
Thank you @bastienboutonnet for your help, right I could do it this way. or cherry-pick every commits or... so many ways to do it with git 😆 |
The pleasure was mine @lavigne958 |
Aim
While
load_credentials()
allows for user's custom credentials path for service account credentials,oauth()
doesn't but as discussed in #826 it looks like it is something several users would appreciate.Given that
oauth()
simply wraps aroundload_credentials()
it seems pretty straightforward to just allowoauth()
to recieve an optional filename.Solution
oauth()
gets a an oprionalcredentials_filename
argument which is then passed down toload_credentials()
and defaults toDEFAULT_AUTHORIZED_USER_FILENAME
so that the change is backward compatible with current documented usage.gspread.oauth()
to look for file in another directory #826To Reviewer's Attention
credentials_filename
, however, I see that you folks generally just usefilename
, happy to keep things consistent here