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

[AL-1356] Dataset Renaming #1538

Merged
merged 25 commits into from
Mar 22, 2022
Merged

[AL-1356] Dataset Renaming #1538

merged 25 commits into from
Mar 22, 2022

Conversation

FayazRahman
Copy link
Contributor

🚀 🚀 Pull Request

Checklist:

  • My code follows the style guidelines of this project and the Contributing document
  • I have commented my code, particularly in hard-to-understand areas
  • I have kept the coverage-rate up
  • I have performed a self-review of my own code and resolved any problems
  • I have checked to ensure there aren't any other open Pull Requests for the same change
  • I have described and made corresponding changes to the relevant documentation
  • New and existing unit tests pass locally with my changes

Changes

@FayazRahman FayazRahman mentioned this pull request Mar 14, 2022
7 tasks
@FayazRahman FayazRahman requested review from farizrahman4u and AbhinavTuli and removed request for farizrahman4u March 14, 2022 13:54
@codecov
Copy link

codecov bot commented Mar 14, 2022

Codecov Report

Merging #1538 (33f19af) into main (366d593) will increase coverage by 0.01%.
The diff coverage is 98.87%.

@@            Coverage Diff             @@
##             main    #1538      +/-   ##
==========================================
+ Coverage   92.23%   92.25%   +0.01%     
==========================================
  Files         194      194              
  Lines       17190    17277      +87     
==========================================
+ Hits        15856    15939      +83     
- Misses       1334     1338       +4     
Flag Coverage Δ
unittests 92.25% <98.87%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
hub/core/storage/gcs.py 74.64% <93.33%> (+1.28%) ⬆️
hub/__init__.py 94.11% <100.00%> (+0.11%) ⬆️
hub/api/dataset.py 90.86% <100.00%> (+0.41%) ⬆️
hub/api/tests/test_api.py 100.00% <100.00%> (ø)
hub/client/client.py 95.37% <100.00%> (+0.13%) ⬆️
hub/core/dataset/dataset.py 92.96% <100.00%> (+0.08%) ⬆️
hub/core/dataset/hub_cloud_dataset.py 90.69% <100.00%> (+0.95%) ⬆️
hub/core/storage/local.py 93.67% <100.00%> (+0.24%) ⬆️
hub/core/storage/s3.py 69.34% <100.00%> (+2.41%) ⬆️
hub/util/exceptions.py 80.71% <100.00%> (+0.19%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 366d593...33f19af. Read the comment docs.

@@ -262,6 +262,39 @@ def load(
except AgreementError as e:
raise e from None

@staticmethod
def rename(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path and name are confusing. Original path and new path or original name and new name might be better

creds = {}

feature_report_path(path, "rename", {})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should check the path, before all of this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checking, should include multiple things, like checking that rename is happening from s3 to s3, gcs to gcs, hub to hub etc + for hub datasets we shouldn't allow renaming with username/xyz/ds

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are checked in the rename method of datasets

if new_bucket != self.client_bucket.name:
raise RenameError
blob_objects = self.client_bucket.list_blobs(prefix=self.path)
for blob in blob_objects:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is happening serially, can't we utilize the multi-worker copy that you had built? Or is there some difference?

@@ -330,6 +330,31 @@ def clear(self):
else:
super().clear()

def rename(self, root):
"""Rename root folder"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question as in gcs provider

@FayazRahman FayazRahman merged commit c1d21e0 into main Mar 22, 2022
@FayazRahman FayazRahman deleted the fy_rename branch March 22, 2022 12:15
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

3 participants