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

DVC: import datachain shortcut #756

Open
dmpetrov opened this issue Dec 28, 2024 · 0 comments
Open

DVC: import datachain shortcut #756

dmpetrov opened this issue Dec 28, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@dmpetrov
Copy link
Member

dmpetrov commented Dec 28, 2024

See this repository as an example: https://github.com/shcheklein/example-datachain-dvc

in dvc.yaml:

...
stages:
  version_data:
    cmd: python src/dc/index.py
    outs:
    - data/dataset.parquet

in src/dc/index.py:

from datachain import DataChain, C

(
    DataChain
        .from_storage("s3://dvc-public-versioned/get-started-pools/", type="image", anon=True)
        .filter(C("file.path").glob("*.jpg") | C("file.path").glob("*.png"))
        .to_parquet("data/dataset.parquet")
)

This seems to be a very common operation and it's better to support this out of the box in dvc.yaml file level. It can look like this without any python code:

...
stages:
  version_data:
    - datachain: "s3://dvc-public-versioned/get-started-pools/**/*.{jpg,jpeg,png}"
         outs: "data/dataset.parquet"
         anon: True

PS: it should also be compatible with SaaS version of DC import

@dmpetrov dmpetrov added the enhancement New feature or request label Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant