-
Notifications
You must be signed in to change notification settings - Fork 1k
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 import endpoint for history contents from library #18960
Conversation
return rval | ||
|
||
for ld in traverse(folder): | ||
hda = ld.library_dataset_dataset_association.to_history_dataset_association(history, add_to_history=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.
You're committing once per added item here, that's what I meant when I said batch import could use some improvements.
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.
rval.extend(traverse(subfolder)) | ||
for ld in folder.datasets: | ||
if not admin: | ||
can_access = security_agent.can_access_dataset( |
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.
There's a can_access_datasets
function that should be more efficient.
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.
oh, ok!
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.
@mvdbeek This function only returns True or False and what will happen if we have a mixed library folder that some have access to and some don't?
Implemented a new API endpoint (
/api/histories/{history_id}/contents/import
) to batch create items in a specified history from library datasets and folders. This enhances flexibility for users by allowing multiple datasets to be imported simultaneously, improving efficiency when updating their histories.The changes include new payload definitions and refined service methods to support the import process.
How to test the changes?
(Select all options that apply)
License