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

Fix for instantiation of pulled dataset #573

Merged
merged 4 commits into from
Nov 13, 2024

Conversation

ilongin
Copy link
Contributor

@ilongin ilongin commented Nov 7, 2024

Adding a fix for instantiated datasets pulled from Studio.
In addition, it adds small improvement for avoiding going to Studio if dataset with specified version is already present locally

@ilongin ilongin changed the title Fix for instantiation pulled dataset Fix for instantiation of pulled dataset Nov 7, 2024
@ilongin ilongin linked an issue Nov 7, 2024 that may be closed by this pull request
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.87%. Comparing base (b0e3a32) to head (24f28a0).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #573      +/-   ##
==========================================
+ Coverage   87.83%   87.87%   +0.04%     
==========================================
  Files         100      100              
  Lines        9993    10007      +14     
  Branches     1356     1357       +1     
==========================================
+ Hits         8777     8794      +17     
+ Misses        873      871       -2     
+ Partials      343      342       -1     
Flag Coverage Δ
datachain 87.81% <100.00%> (+0.04%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@shcheklein shcheklein left a comment

Choose a reason for hiding this comment

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

Thanks @ilongin ! Can we add a test for this?

Copy link
Member

@shcheklein shcheklein left a comment

Choose a reason for hiding this comment

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

Btw, do we have any docs? what is the command that was broken?

@@ -1350,6 +1355,13 @@ def _instantiate_dataset():
# we will create new one if it doesn't exist
pass

if dataset and version and dataset.has_version(version):
"""No need to communicate with Studio at all"""
Copy link
Contributor

Choose a reason for hiding this comment

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

[Q] Is there some validation that happens to confirm that dataset versions are "the same" between local and remote?

Copy link
Contributor

Choose a reason for hiding this comment

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

E.g. my_dataset@v1 on remote is full of PDFs and my_dataset@v1 locally is images.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. No, there is no such thing ATM. Currently it's up to user to make sure he doesn't "shadow" remote dataset. In order to make this kind of validation we need to have equal function between datasets (I will create an issue for this) and my first feeling is that it's not that trivial to implement it (maybe I'm wrong, idk)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, it seems like a simple uuid should be enough for this, which is trivial

@ilongin ilongin requested a review from mattseddon November 8, 2024 06:07
Copy link

cloudflare-workers-and-pages bot commented Nov 8, 2024

Deploying datachain-documentation with  Cloudflare Pages  Cloudflare Pages

Latest commit: 24f28a0
Status: ✅  Deploy successful!
Preview URL: https://64b5c9ed.datachain-documentation.pages.dev
Branch Preview URL: https://ilongin-566-fix-dataset-pull.datachain-documentation.pages.dev

View logs

@ilongin
Copy link
Contributor Author

ilongin commented Nov 8, 2024

Thanks @ilongin ! Can we add a test for this?

Added a test

@ilongin
Copy link
Contributor Author

ilongin commented Nov 8, 2024

Btw, do we have any docs? what is the command that was broken?

Command that was broken was datachain pull ds://some-dataset-from-studio . By default this command pulls dataset to local DB but it also starts instantiation of it and that instantiation was broken. Instantiation can be avoided by adding --no-cp flag.
We can maybe think of removing instantiation as default option and add it as optional (to have --cp flat instead of --no-cp).

So currently if user wants to pull dataset and instantiate it locally, it can be done in two ways:

datachain pull ds://my-bucket -o output_dir  # does pulling and instantiating in one command
datachain pull ds://my-bucket --no-cp  # does only pulling
datachain cp ds://my-bucket output_dir  # instantiating local dataset

@ilongin ilongin requested a review from shcheklein November 8, 2024 14:38
@shcheklein
Copy link
Member

We can maybe think of removing instantiation as default option and add it as optional (to have --cp flat instead of --no-cp).

sounds reasonable to me. Or do a separate command to instantiate it?

@ilongin ilongin merged commit a4eeb92 into main Nov 13, 2024
38 checks passed
@ilongin ilongin deleted the ilongin/566-fix-dataset-pull-instantiation branch November 13, 2024 19:26
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.

Instantiation after pulling remote dataset is failing
3 participants