-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Set corpora and driveId params values based on type of remote disk - shared or user's. #3239
Conversation
dvc/remote/gdrive.py
Outdated
@@ -109,8 +109,11 @@ def init_drive(self): | |||
def gdrive_upload_file( | |||
self, args, no_progress_bar=True, from_file="", progress_name="" | |||
): | |||
param = {"supportsAllDrives": True} |
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.
I think we can keep support*Drivers
family of params inside? They are deprecated anyway and will be enabled by default soon? Also were they present even before we forked the PyDrive?
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.
In original PyDrive from pip some support of related params was added ( deprecated supportsTeamDrives
was used ), but some bugs were fixed in PyDrive's master and not released to pip.
I think we can keep support*Drivers family of params inside?
Sounds good.
|
@Maxris do we still need to update PyDrive to remove corpora/corpus from it? also, just to double check - I hope that all these old |
@Maxris tests are failing on Travis |
@shcheklein yes, iterative/PyDrive2#6 should be merged into PyDrive2. Then we need to release new version of PyDrive2 and update this PR to pin newer version to ensure that Travis tests are passing. |
right, iterative/PyDrive2#6 does exactly above - removes |
good, I've merged it. We will need to release and update the version in the setup.py and conda. |
@Maxris 1.4.2 is released, let's update deps please (and don't forget to update conda when we ready to merge) |
dvc/remote/gdrive.py
Outdated
@@ -104,13 +104,16 @@ def init_drive(self): | |||
), | |||
) | |||
) | |||
self.corpora = "allDrives" | |||
self.remote_drive_id = "" |
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.
would None do here?
dvc/remote/gdrive.py
Outdated
@@ -104,13 +104,16 @@ def init_drive(self): | |||
), | |||
) | |||
) | |||
self.corpora = "allDrives" |
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.
do we need this default value? if not it would be safer to keep them None, to make sure that we don't hit allDrive
after some changes in the future.
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.
yep, we need allDrives
initially, since we don't know initially where the root directory is located - at shared or user's drive.
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.
do we hit any APIs that require corpora
though before we able to figure out this?
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.
well, it looks like it might occur. I will look into possibility to put the assert into PyDrive2 to catch this.
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.
not into PyDrive, probably 🤔 ... I meant that I still don't quite understand why do we need this default ... it's very close to the beginning where we get the actual value for it - default or drive, right? so why do we need this default? is it needed for the period we are still not sure is a shared drive or not? do we hit any APIs that require this value?
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.
@shcheklein sorry, I meant, that, yes, currently ListFile API is called. But it is possible to avoid this, will update the code.
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.
gotcha, yep, let's avoid this if possible and remove the default value
f3a91e0
to
08bf8fd
Compare
dvc/remote/gdrive.py
Outdated
@gdrive_retry | ||
def get_remote_drive_id(self, remote_id): | ||
param = {"id": remote_id} | ||
# drive.CreateFile creates only local GoogleDriveFile object |
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.
...
# it does not create a file on the remote
Codecov Report
@@ Coverage Diff @@
## master #3239 +/- ##
==========================================
- Coverage 92.66% 92.58% -0.09%
==========================================
Files 139 139
Lines 8744 8764 +20
==========================================
+ Hits 8103 8114 +11
- Misses 641 650 +9
Continue to review full report at Codecov.
|
@shcheklein usage of |
17397b1
to
7b0e44e
Compare
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.
Looks good to me! Let's update conda when it's merged.
@Maxris Is this still WIP? 🙂 |
PR is not yet ready: will require update of PyDrive2 along with this PR.
iterative/PyDrive2#6 should be merged first.