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

Raise exception if a view to save's id already exists #2921

Merged
merged 4 commits into from
Aug 2, 2024

Conversation

nvoxland-al
Copy link
Contributor

🚀 🚀 Pull Request

Impact

  • Bug fix (non-breaking change which fixes expected existing functionality)
  • Enhancement/New feature (adds functionality without impacting existing logic)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

A script like this unexpectedly overwrites the existing view:

ds = deeplake.empty("debug_branch_view", overwrite=True)
ds.create_tensor("test")
ds.extend({"test": np.random.rand(100, 100, 3)})
ds.commit("first_commit")
view_1 = ds[0:10]
view_1.save_view(id = "view_id")

view_2 = ds[20:30]
view_2.save_view(id = "view_id")

print(ds.get_views())
print(len(ds.get_views()))

This PR change the 2nd save_view to raise an exception

Copy link

codecov bot commented Aug 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Copy link

sonarcloud bot commented Aug 2, 2024

@nvoxland-al nvoxland-al merged commit 3794f91 into main Aug 2, 2024
9 of 10 checks passed
@nvoxland-al nvoxland-al deleted the stop_view_overwrite branch August 2, 2024 19:33
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.

4 participants