[DAR-3041][External] Change the behaviour of the force_slots
argument of pull()
#915
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Currently when pulling a dataset release with darwin-py, if:
Then every item is named and structured into directories in the multi-slotted way. That is the paths include the slot name:
{prefix}/{item_name}/{slot_name}/{file_name}
This is because if any item meets either condition 1 or 2 above, we set
force_slots=True
for all itemsIf a user passes
force_slots=False
topull()
(which is the default behaviour), we should passforce_slots=False
for all single-slotted, single-source-file items, but asTrue
for all other items, since in that case it only makes sense for the local paths of multi-slotted / multi-source-file items to include the slot namesSolution
Instead of passing the same value of
force_slots
for all items, determine & record the value offorce_slots
for every item to be downloaded, then propagate these values into the download functionsChangelog
When downloading dataset releases containing a mixture of multi-slotted & single-slotted items, only represent the slots of the multi-slotted items locally