Skip to content
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

Changes to rename() #2854

Merged
merged 11 commits into from
May 23, 2024
Merged

Changes to rename() #2854

merged 11 commits into from
May 23, 2024

Conversation

nvoxland-al
Copy link
Contributor

@nvoxland-al nvoxland-al commented May 14, 2024

🚀 🚀 Pull Request

Impact

  • Optimization
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Previously, deeplake.rename() and dataset.rename() tried to rename both managed and unmanaged datasets.

  • For managed datasets, it would change the URL to the dataset without impacting the underlying storage.
  • For unmanaged datasets, it would move the storage location from one location to another. For storage systems that do not support "move" operations, it would copy and delete the data

This PR removes the "rename" support for non-managed datasets, to avoid confusion on whether it does anything to the underlying storage or not. It's now purely a way to rename the URLs of a managed (hub://) dataset.

It also adds the ability to just give the new name as the argument to rename rather than the whole new URL. So the new preferred syntax is: deeplake.rename("hub://my_org/old_path", "new_path" or dataset.rename("new_path"). In either case the new URL will be hub://my_org/new_path

Things to be aware of

That change does mean that you can't use deeplake.rename() to do a storage-level "move" anymore, but that was never the purpose of this method.

@istranical istranical self-requested a review May 14, 2024 20:52
deeplake/api/dataset.py Outdated Show resolved Hide resolved
@nvoxland-al nvoxland-al changed the title deeplake.rename() improvements deeplake.rename() changes May 21, 2024
@nvoxland-al nvoxland-al changed the title deeplake.rename() changes Changes to rename() May 21, 2024
Copy link

sonarcloud bot commented May 22, 2024

@nvoxland-al nvoxland-al merged commit 7869411 into main May 23, 2024
5 of 10 checks passed
@nvoxland-al nvoxland-al deleted the deeplake_rename branch May 23, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants