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

api: Repo.stage for loading/dumping stages #4886

Closed
skshetry opened this issue Nov 12, 2020 · 1 comment · Fixed by #4976
Closed

api: Repo.stage for loading/dumping stages #4886

skshetry opened this issue Nov 12, 2020 · 1 comment · Fixed by #4976
Assignees
Labels
enhancement Enhances DVC p1-important Important, aka current backlog of things to do

Comments

@skshetry
Copy link
Member

Right now, this service was provided through Dvcfile.stages and Dvcfile.stage. The problem with the API is it requires us to create Dvcfile each time even if we don't need it.

We already have wrappers around it due to above reason:

def get_stage(self, path=None, name=None):

def get_stages(self, path=None, name=None):

This might get more complicated with group stage run target, i.e. name of the stage group of a foreach.
So, it'd be great to have a simple wrapper that'd look like this:

>>> repo.stage.load_one("build", file="dvc.yaml")
>>> repo.stage.load_all(file="data.csv.dvc")
>>> repo.stage.load(target="", file="")

The API might improve, when trying to improve this. That is what I have in mind.

@skshetry skshetry added enhancement Enhances DVC p1-important Important, aka current backlog of things to do labels Nov 12, 2020
@skshetry skshetry self-assigned this Nov 12, 2020
@efiop
Copy link
Contributor

efiop commented Nov 12, 2020

@skshetry Is it required for some other feature/usecase? Just wondering about the background.

skshetry added a commit to skshetry/dvc that referenced this issue Nov 26, 2020
skshetry added a commit that referenced this issue Nov 27, 2020
* repro: support regex/foreach-group to run at once

Fixes #4912
Fixes #4886
Fixes #4958

* Use `tree.isdir` rather than `os.path.isdir`

* Use glob rather than regex

* Update dvc/command/repro.py

* s/regex/glob

* disable glob on `collect_granular`

There's no need for a glob here

* add tests for `collect` and `collect_granular`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhances DVC p1-important Important, aka current backlog of things to do
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants