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

Client authentication issue with gspread library #100

Open
shannon-carman opened this issue Feb 2, 2024 · 12 comments
Open

Client authentication issue with gspread library #100

shannon-carman opened this issue Feb 2, 2024 · 12 comments

Comments

@shannon-carman
Copy link

Hello! I've been using this library in an automated workflow for the last few months and started getting authentication errors on 1/28/24, which I noticed coincided with the release of gspread 6.0.0. I started getting an 'AuthorizedSession' object is not callable which I traced back to this line:

super().__init__(credentials, session)

where the gspread-pandas Client instantiates a gspread Client and passes in an AuthorizedSession argument. However, with the lastest gspread release, the Client super init method does not take a session argument (see line 41 of client.py on the branch)
https://github.com/burnash/gspread/pull/1382/files#diff-4c3073178c56b478cd7537564a01ef8a43ead328aef864d8afa7e70625560d73
Screen Shot 2024-02-02 at 9 48 13 AM

@BartStikkers
Copy link

I ran into the same issue. As a workaround, installing gspread version 5.12.4 explicitly before gspread-pandas resolves it.

@MegumiMagica
Copy link

It's because Gspread 6 updates to the new Google API V4 and I believe they changed the autherization method. It looks like this project hasn't had a release in almost 2 years. Is this an abandoned project?

mephinet added a commit to mephinet/gspread-pandas that referenced this issue Feb 13, 2024
@alifeee
Copy link

alifeee commented Feb 13, 2024

Hi! gspread released v6.0.1 recently, which may have fixed your issue. Can you check if it has?

@BartStikkers
Copy link

Hi! gspread released v6.0.1 recently, which may have fixed your issue. Can you check if it has?

I checked just now. Same error. Interestingly, it seems I ran into this issue because I installed gspread locally through conda-forge, and that is still on version 5.12.4. When I deployed to Google Cloud Functions, that used the version from pip instead. Good to keep that in mind for the future, I suppose.

@alifeee
Copy link

alifeee commented Feb 13, 2024

ah yes. this is due to an architechtural change in v5->v6. @lavigne958 knows more about it, and can provide more info, as made the change

@aiguofer
Copy link
Owner

Hey all, yeah unfortunately I haven't really used this project in years. I've been trying to maintain as best effort, but the changes necessary to support gspread 6 might be too much for me right now. I'll release a version that limits gspread < 6 (thanks @mephinet for the PR), but won't have time to make all the changes to make a new version compatible with 6. PRs welcome!

@BartStikkers
Copy link

@aiguofer Understandable. I don't see myself having time to dive into it, so I guess the safer option long-term is to refactor to remove gspread-pandas? I'll have to discuss with my team about allocating dev time one way or the other.

@lavigne958
Copy link

Hi everyone, yes we updated the gspread architecture in v6 and now the gspread client requires an HTTPClient object at init.

it is provided when using the functions like gspread.service_account() or gspread.oauth().

I'll make the necessary changes, first we should fixup gspread to be compliant with previous arguments in order to init a new client and optional arguments with default value.

then I can provide a PR here to upgrade and benefit from new code.

@lavigne958
Copy link

Hello everyone, it's done, we fixed the order of input arguments to init a new gspread client, it should now work out fo the box with gspread-6.0.2.

please let us know if it's not the case, we'll investigate.

@aiguofer
Copy link
Owner

Awesome thanks! I'll make a new release that supports >= 6.0.2

@aiguofer
Copy link
Owner

Well, I tried making the change today but unfortunately there's a few more changes that will need to happen. For example, there is now longer a Client.request method, now that belongs to Client.http_client. I'll likely need to dig a bit deeper into other breaking changes before I can make it compatible with v6, but sadly I don't have much time nowadays to work on the library.

@lavigne958
Copy link

lavigne958 commented Feb 15, 2024

Oh god you're right I did not think of this one.

Yes I'll make a new PR in gspread-pandas for this change and I'll take this chance to test it a bit too.

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

No branches or pull requests

6 participants