-
Notifications
You must be signed in to change notification settings - Fork 0
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
First Pass at a Bulk Reassign #24
base: main
Are you sure you want to change the base?
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.
Just a few suggestions for improvement - I'll hold off on testing just in case you want to take on some of the more major suggestions detailed in the comments
bulk_reassign_docs.py
Outdated
try: | ||
response = client.patch( | ||
f"v2/files/{file_id}", | ||
json={"ownerId": user_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.
Without a parentId
, what happens with workbooks and unsaved explorations? Would these all be dumped into someone's "My documents" section? (I assume if the workbooks are in a workspace, then they won't be moved)
Could it be better to allow the end user to optionally designate a folder into which these reassigned files will go?
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.
added optional arg for 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.
LGTM - in summary, there's just a few minor camel-to-snake cases and validating that the destination folder is owned by the intended owner, but other than that, all clear (spare for testing) - will get ready to test soon.
bulk_reassign_docs.py
Outdated
|
||
""" | ||
updateFileBody={"ownerId": user_id} | ||
if folderID: |
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.
We should probably also verify that the owner of the destination folder matches the new_owner_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.
We should probably throw an error and abort entirely if the owner of the folder doesn't match the new owner's ID actually
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.
No description provided.