-
Notifications
You must be signed in to change notification settings - Fork 573
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
Connector for Google Drive #294
Connector for Google Drive #294
Conversation
Hi, @cragwolfe I'd appreciate it if a review could begin on my PR. Everything works as expected from running it, but I am looking to do two more things: Integrate Google's Auth ID (so files can be downloaded without making them available for everyone to view) and find a way to allow downloads on public files without a token. I'm not sure why the CI CD checks are not running at the moment. No tests at the moment since API keys are needed (I'm not sure how to go about creating a test for that without exposing keys). |
Hi @HAKSOAT , happy to! Great to hear you got this working.
Does that mean following the
I think it was mostly the gihub outage. I just merged into Main to help trigger that (hope that's OK!).
How does one go about getting an API Key? A few more things to address:
|
with open(self.filename, "wb") as handler: | ||
handler.write(file.getbuffer()) | ||
if self.config.verbose: | ||
print(f"File downloaded: {self.filename}.") |
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.
what would be the else
condition (i.e. if not file
)? should we print a warning if unexpected? (someday soon this would be "log a warning" but logging in multiprocessing is not working yet).
Hi @cragwolfe Thanks for the review. I'll go through your comments now.
More like here: https://developers.google.com/workspace/guides/create-credentials I believe a service account is better as it is made for robot accounts. The reason is that the regular API key gets throttled as I experienced an error after a couple of requests that says:
|
…ured into ingest_connector/gdrive
Hi @cragwolfe I think I just hit a roadblock for service accounts. Looks like there's an issue with using the service account approach with multiprocessing.
The traceback isn't so helpful either. Just putting this here to serve as an update as I have tried to find a fix but I am yet to find one. I will take another look in the morning here. |
Yes, looks that way. A way around that is to remove |
Thanks for the hint @cragwolfe It works now. I think a second review will be great so I can fix any other issue. |
Hi @cragwolfe please can you help take a look at this when chanced? |
|
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.
Works very nicely! 🚀
Though, I did get tripped up by not reading the Note in ingest.sh carefully enough the first time:
# NOTE: Using the Service Account key only works when the file or folder
# is shared atleast with permission for "Anyone with the link" to view
# OR the email address for the service account is given access to the file
# or folder.
service account emails do not look like user emails.
Implements enhancement #244