-
Notifications
You must be signed in to change notification settings - Fork 950
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
Add missing method import_csv()
#1426
Conversation
Prior to v6.x.y the method could be used as follow: file = client.open('x') file.client.import_csv() Now file.client is of type HTTPClient so we need to add the method back for backward compatibility closes #1423 Signed-off-by: Alexandre Lavigne <lavigne958@gmail.com>
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.
This looks good. I only note:
I don't think import_csv
makes sense within HTTP_Client
? This method provides spreadsheet functionality, so it should be in gspread.Client
?
I am not fully up to date with the idea of the HTTP_Client
, but my understanding is that it was made so that people could make their own custom HTTP_Client
s easier. Then, they would have to make their own import_csv
method? Should this not belong to Client
?
I see that it might have to be in HTTP_Client
, because of hierarchical reasons. If this is the case, then I guess we must leave it.
I know 😞 I faced the same thought, I wish it could only be located in the client itself and only be used like: I agree, the HTTPClient allows users to make their own if necessary, and mostly it is here to handle only pure HTTP calls, on the least amount of logic. The way the project was designed before, allowed users to reach the argument what we can do is:
which is in the end: make no changes, as currently the documentation of the function shows that you should use that function using the gspread client directly, it never shows that you can reach it from elsewhere. or add it back to the HTTPClient so users can do: |
This is a good question. I er towards adding it to the HTTPClient. As, in the end, if someone wanted to make their own, they would probably create a sub-class of the HTTPClient, and override the request methods. So the import_csv etc methods would remain. Maximum backwards compatibility :) |
agreed, we can later depreciate it, like before for the v6.0.0, but this time we should have way less methods to depreciate ! so it should be much easier. |
thinking about it, I have no changes to make currently right ? unless I forgot something. |
something must be changed to fix #1423, no? |
the current pull request will fix it. and the pull request adds a new method I am waiting for your review/approval mostly now that we agree on leaving the new method. 🙃 Unless: I did not understand and we still need to find a solution, which is fine. |
Prior to v6.x.y the method could be used as follow:
file = client.open('x')
file.client.import_csv()
Now file.client is of type HTTPClient
so we need to add the method back for backward compatibility
closes #1423