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

introduce dvc list command #3246

Merged
merged 1 commit into from
Feb 12, 2020
Merged

introduce dvc list command #3246

merged 1 commit into from
Feb 12, 2020

Conversation

gurobokum
Copy link
Contributor

@gurobokum gurobokum commented Jan 28, 2020

Provides dvc list command

usage: dvc list [-h] [-q | -v] [-R] [--rev [REV]] url [targets [targets ...]]

List DVC outputs in the repo

positional arguments:
  url              Supported urls:
...
  targets          Paths to directories within the repository to list outputs for.

optional arguments:
  -h, --help       show this help message and exit
  -q, --quiet      Be quiet.
  -v, --verbose    Be verbose.
  -R, --recursive  Recursively list files under directory targets.
  --rev [REV]      Git revision (e.g. branch, tag, SHA

Uses sparse checkout for remote repos, but missed opportunity to list artifacts in repo by SHA commit (only by refs). Will be fixed in next commits
As an alternative I looked to the partial-clone but have chosen sparse checkout as the simplest solution, open for suggestions
targets params filter artifacts/outputs and not dvc-file locations

Close #2509


  • ❗ Have you followed the guidelines in the Contributing to DVC list?

  • 📖 Check this box if this PR does not require documentation updates, or if it does and you have created a separate PR in dvc.org with such updates (or at least opened an issue about it in that repo). Please link below to your PR (or issue) in the dvc.org repo.

  • ❌ Have you checked DeepSource, CodeClimate, and other sanity checks below? We consider their findings recommendatory and don't expect everything to be addressed. Please review them carefully and fix those that actually improve code or fix bugs.

  • Sufficient test coverage is provided

  • Support SHA commits as rev

  • There are shell completion scripts

@gurobokum gurobokum changed the title api: add list command [WIP] api: add list command Jan 28, 2020
dvc/repo/list_outs.py Outdated Show resolved Hide resolved
dvc/cli.py Outdated Show resolved Hide resolved
dvc/external_repo.py Outdated Show resolved Hide resolved
dvc/external_repo.py Outdated Show resolved Hide resolved
dvc/repo/list_outs.py Outdated Show resolved Hide resolved
dvc/repo/list_outs.py Outdated Show resolved Hide resolved
dvc/repo/list_outs.py Outdated Show resolved Hide resolved
dvc/repo/list_outs.py Outdated Show resolved Hide resolved
@jorgeorpinel
Copy link
Contributor

Hi. Will, --show-url from dvc get be moved to this new command in this introductory PR, or will that be left for a future review? Thanks!

@gurobokum
Copy link
Contributor Author

gurobokum commented Jan 29, 2020

Hi @jorgeorpinel
Do you expect something like

dvc list  --show-url https://github.com/iterative/dataset-registry
tutorial/ver/new-labels.zip     https://remote.dvc.org/dataset-registry/2e/aa473159443e75e6fb7b29e56c0787
tutorial/nlp/pipeline.zip       https://remote.dvc.org/dataset-registry/1d/2070ee188fc5e4d94ad920e6cc82aa
get-started/data.xml            https://remote.dvc.org/dataset-registry/a3/04afb96060aad90176268345e1035
...

If it needs I can add --show-url to list command in this PR
And maybe --show-remote is better option name, what do you think?

@efiop
Copy link
Contributor

efiop commented Jan 29, 2020

@JIoJIaJIu @jorgeorpinel --show-url is out of scope for this PR. For now there is no agreement on whether it should be moved to dvc list.

@gurobokum gurobokum force-pushed the dvc_list branch 2 times, most recently from 7e94ab0 to 60c4fb4 Compare January 30, 2020 23:50
Copy link
Contributor

@efiop efiop left a comment

Choose a reason for hiding this comment

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

tests/unit/command/.test_list.py.swo looks like some garbage made its way into your patch 🙂

@efiop
Copy link
Contributor

efiop commented Jan 31, 2020

@JIoJIaJIu Please rebase.

Copy link
Contributor

@efiop efiop left a comment

Choose a reason for hiding this comment

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

Looks pretty good @JIoJIaJIu ! I've tried running this a few times and it works as requested 🙂 Let's add tests and clean this up.

dvc/repo/ls.py Outdated Show resolved Hide resolved
dvc/repo/ls.py Outdated Show resolved Hide resolved
dvc/repo/ls.py Outdated Show resolved Hide resolved
dvc/repo/ls.py Outdated Show resolved Hide resolved
dvc/repo/ls.py Outdated Show resolved Hide resolved
dvc/repo/ls.py Outdated Show resolved Hide resolved
dvc/path_info.py Outdated Show resolved Hide resolved
dvc/path_info.py Outdated Show resolved Hide resolved
dvc/repo/ls.py Outdated Show resolved Hide resolved
@efiop
Copy link
Contributor

efiop commented Jan 31, 2020

Btw, it should work with git-only repos as well, since get/import do too.

(3.7.0-dvc) ➜  dvc git:(dvc_list) dvc list https://github.com/iterative/dvc.org                   
ERROR: failed to list 'https://github.com/iterative/dvc.org' - you are not inside of a DVC reposit
ory (checked up to mount point '/')                                                               
                                                                                                  
                                                                                                  
Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!           

Copy link
Contributor

@Suor Suor left a comment

Choose a reason for hiding this comment

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

I suggest two things to clarify/simplify this:

  • do not support multiple targets
  • understand target path as relative to repo root, same as in get and import

dvc/path_info.py Outdated Show resolved Hide resolved
dvc/repo/ls.py Outdated Show resolved Hide resolved
dvc/repo/ls.py Outdated Show resolved Hide resolved
dvc/repo/ls.py Outdated Show resolved Hide resolved
dvc/repo/ls.py Outdated Show resolved Hide resolved
dvc/repo/ls.py Outdated Show resolved Hide resolved
dvc/repo/ls.py Outdated
Comment on lines 67 to 71
def in_target(out, target_path_info, is_dir):
if out.scheme == "local" and out.path_info == target_path_info:
return True

if is_dir:
if recursive and out.path_info.isin(target_path_info):
return True
if out.path_info.isin(target_path_info, 1):
return True

return False
Copy link
Contributor

Choose a reason for hiding this comment

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

This duplicates Repo.find_outs_by_path(..., strict=False)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, one thing I wanted to clarify

dvc list repo target_dir

should return like ?

target_dir

I don't see the use case of such behavior for the user

I think that if user pointes the folder in the target it expect to see the content of it like (without -R flag)

target_dir/file1
target_dir/subfolder

and when he points -R flag it means to check subfolder


target_dir/file1
target_dir/subfolder
target_dir/subfolder/file2

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 a really good question. But to answer it, I would look into behavior of existing commands. For example ls target_dir and aws s3 ls s3://bucket/target_dir will show just target_dir. So I would stick to that. 🙂

Copy link
Member

Choose a reason for hiding this comment

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

regarding -R - please, let's not use it. Let's use a regular ls-like, aws-ls like -r, --recusrsive. Along with some flag to filter only outputs.

Also, good question if we want and how do we want to show DVC-files along with the data they reference to.

Also, @JIoJIaJIu could you please share https://asciinema.org/ with different outputs to make it easier to review it? Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ls shows content of the folder by default, but supports -d option for listing dirs rather then content
aws s3 ls s3://bucket/target_dir also lists dir and with slash at the end it shows content
aws s3 ls s3://bucket/target_dir/
Based on discord communication we decided to implement showing taget_dir by default as ls -d does.
It allows user to check does the folder exists in the repo or not and make the api more simple

$ dvc list url target_dir
target_dir

Copy link
Contributor

Choose a reason for hiding this comment

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

@shcheklein Let's use -R, same as in other commands. Otherwise it will overlap with -r|--remote.

Copy link
Contributor

Choose a reason for hiding this comment

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

That cause I've implemented multiple targets support I didn't want to traverse all stages and outs on every target request. So it is a kind of optimization

Let's not optimize it that way then 🙂 Let's only accept one target and use find_outs_by_path.

Copy link
Member

Choose a reason for hiding this comment

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

ok, yes, I see that ls has -R indeed. Disregard my comment on this @JIoJIaJIu!

Copy link
Contributor

@efiop efiop Feb 2, 2020

Choose a reason for hiding this comment

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

@JIoJIaJIu hm, though dvc list url . is a corner case of that approach 🙂 A natural behavior for . is to treat it as ./. So maybe I'm wrong there and we should consider it more carefully. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@efiop
I think that dvc list dir always should show content of the dir like

$ dvc list dir
file1
subdir

and apply behavior of ls -d only with target for checking does it exist or not

$ dvc list dir subdir
subdir

dvc/repo/ls.py Outdated
Comment on lines 99 to 97
result = list(set(result))
result.sort()
return result
Copy link
Contributor

Choose a reason for hiding this comment

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

return sorted(set(result))

Also, why set? Do we expect them to be duplicate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me check, I remember that faced with duplicated rows, but maybe it was an issue in the logic if outs cannot be duplicated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've got how it can happen - the output can be fetched/generated and exists on the fs. Hence it will be returned from _ls_files and from _ls_outs also which leads to duplicates in the output

dvc/repo/ls.py Show resolved Hide resolved
dvc/repo/ls.py Outdated Show resolved Hide resolved
@Suor
Copy link
Contributor

Suor commented Feb 1, 2020

On single/multiple targets: we don't have any agreement of how this should look for multiple targets. We opted for implementing a flat list, but that only works for single one. See how ls works with multiple targets, it's quite different.

@gurobokum
Copy link
Contributor Author

gurobokum commented Feb 2, 2020

The last commit contains only changes requested by @efiop , for your notes @Suor I will provide in the next one

single/multiple targets: we don't have any agreement of how this should look for multiple targets

I think about targets as a filter that applied on the output, so multiple targets just means multiple filter, similar to

dvc list . | grep -E "a|b"

but that cares about folder structure

(dvc) jiojiajiu@pon4ik:~/workspace/dvc/list (dvc_list)$ tree
.
├── a
│   ├── 1
│   └── 2
├── b
│   ├── 1
│   ├── 2
│   └── a
│       ├── 1
│       └── 2
└── c
    ├── 1
    └── 2

4 directories, 8 files

(dvc) jiojiajiu@pon4ik:~/workspace/dvc/list (dvc_list)$ dvc list . -R | grep -E "a|c"
a
a/1
a/2
b/a
b/a/1
b/a/2
c
c/1
c/2

(dvc) jiojiajiu@pon4ik:~/workspace/dvc/list (dvc_list)$ python -m dvc list . a c -R
a/1
a/2
c/1
c/2

ls works like differently but IMHO it doesn't make sense to make it the same for dvc list, may be just with some option like -h|--human

(dvc) jiojiajiu@pon4ik:~/workspace/dvc/list (dvc_list)$ ls a b
a:
1  2

b:
1  2  a
(dvc) jiojiajiu@pon4ik:~/workspace/dvc/list (dvc_list)$ ls -l a b
a:
total 0
-rw-rw-r-- 1 jiojiajiu jiojiajiu 0 Feb  2 14:34 1
-rw-rw-r-- 1 jiojiajiu jiojiajiu 0 Feb  2 14:34 2

b:
total 4
-rw-rw-r-- 1 jiojiajiu jiojiajiu    0 Feb  2 14:34 1
-rw-rw-r-- 1 jiojiajiu jiojiajiu    0 Feb  2 14:34 2
drwxrwxr-x 2 jiojiajiu jiojiajiu 4096 Feb  2 14:47 a

What do you think?


UPD: I decided to get rid of multiple targets support

tests/func/test_ls.py Outdated Show resolved Hide resolved
for dirpath, dirnames, filenames in tree.walk(target_path):
files.extend(map(lambda f: PathInfo(dirpath, f), filenames))
if not recursive:
files.extend(map(lambda d: PathInfo(dirpath, d), dirnames))
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 probably the cause of that bug. This line should be outside of if, right?

@gurobokum
Copy link
Contributor Author

@JIoJIaJIu There is some bug:

(3.7.0-dvc) ➜  dvc git:(dvc_list) ✗ dvc list https://github.com/iterative/dvc scripts 
scripts                                                                               
(3.7.0-dvc) ➜  dvc git:(dvc_list) ✗ dvc list https://github.com/iterative/dvc scripts/
scripts                                                                               

It's not a bug but a feature))
Let me summarize request

When target contains slash at the end (/ - nix and \ - for windows) needs to output content of the target

Copy link
Member

@skshetry skshetry left a comment

Choose a reason for hiding this comment

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

Looking good in general. Tried and works well (see below for an edgecase). I'd like to have a more few tests for external repo (git-only + dvc) with possible combinations such as rev, etc. The tests you have added are good, but mostly covers the local dvc repo cases only. 🙂

recursive=self.args.recursive,
outputs_only=self.args.outs_only,
)
logger.info("\n".join(nodes))
Copy link
Member

Choose a reason for hiding this comment

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

If there are no nodes, logger.info will add a newline on the output.

dvc/repo/ls.py Show resolved Hide resolved
dvc/repo/ls.py Outdated Show resolved Hide resolved
Comment on lines 133 to 142
m = mocker.patch("dvc.scm.Git.clone")

def clone_repo(url, to_path, *args):
assert url == "git://github.com:repo"
copy_tree(fspath(tmp_dir), to_path)
return Git(fspath(tmp_dir))

m.side_effect = clone_repo

files = Repo.ls("git://github.com:repo")
Copy link
Member

@skshetry skshetry Feb 10, 2020

Choose a reason for hiding this comment

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

If you want to test with external repo, you can use erepo_dir fixture to create an external dvc repo and git_dir for external git-only repository. If you want to test with url, you can use file:// based urls as well. No need to mock.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if file:// works these days. In any case, the logic still passes this to external_repo, so we could use local paths here with the same effect. I know that previously we've had a different implementation here for which the url in tests mattered, but it is no longer like that, so we could simplify and use erepo_dir as @skshetry suggested 🙂

Copy link
Member

@skshetry skshetry Feb 10, 2020

Choose a reason for hiding this comment

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

@Suor always adds file:// for external repo in combination with erepo_dir with# Use URL to prevent any fishy optimizations kind-of comments. So, that seems to work.

# Use URL to prevent any fishy optimizations
url = "file://{}".format(erepo_dir)
with external_repo(url) as repo:

@efiop
Copy link
Contributor

efiop commented Feb 10, 2020

I'd like to have a more few tests for external repo (git-only + dvc) with possible combinations such as rev, etc. The tests you have added are good, but mostly covers the local dvc repo cases only. slightly_smiling_face

@skshetry Good point! This patch only uses external_repo, same as other commands like get/import, so creating more tests for it is out-of-focus for this PR, we can create a ticket and get back to it later though.

@gurobokum
Copy link
Contributor Author

I would like to pay attention on the command behaviour when target requested with --outs-only flag

LICENSE target exists into the repo (simple file)

$ dvc list https://github.com/iterative/dvc LICENSE
LICENSE

But when we request --outs-only the command returns nothing and doesn't throw an error

$ dvc list https://github.com/iterative/dvc LICENSE --outs-only

$ dvc list https://github.com/iterative/dvc NOT_EXISTED_LICENSE
ERROR: failed to list 'https://github.com/iterative/dvc' - The path 'NOT_EXISTED_LICENSE' does not exist in the target repository 'ExternalRepo: '/tmp/tmpms1fw854dvc-erepo'' neither as an output nor a git-handled file.

Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!

@gurobokum gurobokum requested review from efiop and skshetry February 11, 2020 18:57
@efiop
Copy link
Contributor

efiop commented Feb 11, 2020

I would like to pay attention on the command behaviour when target requested with --outs-only flag

@JIoJIaJIu Do you think we should raise an error there? 🙂

@gurobokum
Copy link
Contributor Author

I would like to pay attention on the command behaviour when target requested with --outs-only flag

@JIoJIaJIu Do you think we should raise an error there? slightly_smiling_face

@efiop I see that we shouldn't. Idea is that target exists into the repo, but this target doesn't contain dvc artificats (and isn't it by itself), for example

dvc list url my_folder_which_exists --outs-only

The behavior with throwing an error as not existed target can confuse user rather then empty output, which shows how many(0) dvc artifacts exist into the target

@efiop
Copy link
Contributor

efiop commented Feb 11, 2020

@JIoJIaJIu But --outs-only implies that you are only looking for outputs, so it erroring out if it doesn't find any outputs makes sense. --outs-only is only limiting the scope, the behaviour should stay the same as with full scope.

I think it is better to illustrate it with an example. Imagine that you are writing a shell script (with set -e that will make it error-out on first error) and want to use dvc list output to dvc get stuff. You would do something like:

dvc list URL path | xargs -0 dvc get URL "{}"

and if there is no path in URL, then dvc ls would error-out. Now you want to only get outputs. You would do:

dvc list URL path --outs-only | xargs -0 dvc get URL "{}"

but now your dvc list won't error-out, but just will print nothing, so your script will keep going. Which means that dvc list behaviour is inconsistent in how it handles errors.

dvc/repo/ls.py Outdated

if not outs_only:
result.extend(files)
target_path_info = _get_target_path_info(repo, target)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure you can move this up and just pass target_path_info instead of target to other methods. Currently you are calling this helper three times for no reason 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently you are calling this helper three times for no reason

The idea was to keep function interface lightweight and simple - _ls_outs and _ls_files requires only repo which is transparent and make the functions more simple to use. With target_path_info param I don't like much how functions signature looks

@gurobokum
Copy link
Contributor Author

@efiop I've applied the changes. I think it's a philosophy question and a few ways are possible.
If you think it's right way - let's do it, but let me summarize my thoughts bellow, maybe you find them relevant

TLDR

As you know the idea of throwing an error on not existed target is not close to me in general
I think get throws an error on not existed target cause the result of the command depends on the existence, but it's not the same for list command
If we list not existed url (aka repo) - the error should be thrown, but when we list not existed target - shouldn't. I thought about the url as a source and about the target as a filter.
After conversation we got that source = url + target

and if there is no path in URL, then dvc ls would error-out

we've chosen such behavior as a requirement, so the error in the script shows that the requested source is invalid

but now your dvc list won't error-out, but just will print nothing, so your script will keep going. Which means that dvc list behaviour is inconsistent in how it handles errors

here, the requested source is valid, but there are no outs there - what is the different case. So if our script should get 1+ outputs on list it should be solved separately and

dvc list URL path --outs-only | xargs -0 dvc get URL "{}"

shouldn't throw if there are no outs on path but path exists

@gurobokum gurobokum force-pushed the dvc_list branch 2 times, most recently from a5ca20c to 4b3b5a9 Compare February 12, 2020 01:30
@gurobokum gurobokum requested a review from efiop February 12, 2020 01:31
@efiop
Copy link
Contributor

efiop commented Feb 12, 2020

@JIoJIaJIu Thanks for the explanation! I don't think it justifies the behaviour inconsistency from my example though 🙂

I would understand your approach if we would've stuck to filter-like approach in the base case, where we would not error-out and would simply print nothing, but I think it contradicts itself in its current form as it mismatches the approaches and results in an inconsistency between those two cases.

I feel like the misunderstanding here is in the way we understand the ordering of operations here. You seem to be thinking about --outs-only as a filter that is applied ON TOP of the result from the default dvc ls, while I think about it as a filter that applies to the set of files that is being fed to dvc ls. So in your view dvc ls --outs-only is filter(filter(ALL_FILES, path), is_dvc_out) while it is filter(filter(ALL_FILES, is_dvc_out), path) in my view, so I can clearly see that the behaviour should be the same as in default case.

But let's consider your view. We've established that in default case filter(ALL_FILES, path) raises an error if path doesn't exist, right? If so and we generalize it, we get that filter(SET, criteria) should raise an error if criteria is not met, right? If so, your view can be rewritten as filter(FILTERED_SET, is_dvc_out), so if there are no dvc outs in the FILTERED_SET, it means that criteria is not met and we need to raise an error, so your approach contradicts itself in its current form. 🙂 I might've gone too far here, though 😅

dvc/repo/ls.py Outdated
result.extend(_ls_files_repo(target_path_info, recursive))

if target and not result:
raise PathMissingError(target, repo)
Copy link
Contributor

Choose a reason for hiding this comment

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

For the record: discussing improving this error in --outs-only case in PMs.

Copy link
Contributor

@efiop efiop left a comment

Choose a reason for hiding this comment

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

Looks really good! Let's fix up that exception message and we'll merge and will address the rest later.

Copy link
Contributor

@efiop efiop left a comment

Choose a reason for hiding this comment

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

Thank you @JIoJIaJIu ! 🙏

@efiop efiop merged commit 7e6e8ee into iterative:master Feb 12, 2020
@gurobokum gurobokum deleted the dvc_list branch February 17, 2020 09:28
Copy link
Contributor

@jorgeorpinel jorgeorpinel left a comment

Choose a reason for hiding this comment

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

Late to this party but reviewing after the fact given that we'll also take over iterative/dvc.org/pull/967 now. I can probably address my own review here as well but feel free to do so or give any feedback.

  • Update also autocomplete scripts and tests.



def add_parser(subparsers, parent_parser):
LIST_HELP = "List files and DVC outputs in the repo."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
LIST_HELP = "List files and DVC outputs in the repo."
List repository contents, including files and directories tracked by DVC and by Git.

per iterative/dvc.org/pull/967

Comment on lines +43 to +49
help="Supported urls:\n"
"/path/to/file\n"
"/path/to/directory\n"
"C:\\\\path\\to\\file\n"
"C:\\\\path\\to\\directory\n"
"https://github.com/path/to/repo\n"
"[email protected]:path/to/repo.git\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

help="Location of DVC repository to list"
similar to dvc import. Should be obvious for most people what it means and we'll explain it in docs (again, same as with get/import).

Copy link
Contributor

Choose a reason for hiding this comment

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

BTW the args in the -h output of get and import is slightly different (2 lines vs 1 line):

$ dvc get -h
...
positional arguments:
  url                   Location of DVC project or Git repository to download
                        from
  path                  Path to a file or directory within the project or
                        repository

$ dvc import -h
...
positional arguments:
  url                   Location of DVC project or Git repository to download from
  path                  Path to a file or directory within the project or repository

dvc/command/ls.py Show resolved Hide resolved
def __init__(self, path, repo):
default_msg = (
"The path '{}' does not exist in the target repository '{}'"
" neither as an output nor a git-handled file."
Copy link
Contributor

Choose a reason for hiding this comment

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

"...as a DVC output nor as a Git-tracked file."

)
default_msg_output_only = (
"The path '{}' does not exist in the target repository '{}'"
" as an output."
Copy link
Contributor

Choose a reason for hiding this comment

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

as an DVC output

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.

new command to list data artifacts in a DVC project
6 participants