mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
index: introduce data_keys (#8938)
`data_keys` are similar to `outs`, but they provide more granularity, so we can use them in `build_data_index` to rebuild index views with filtered outputs. E.g. when running `dvc diff dir/file`, workspace index should only have `dir/file` in it. This also could be used for standalone (non-output) data in the future. Pre-requisite for #8930
This commit is contained in:
@@ -199,6 +199,13 @@ def test_view_granular_dir(tmp_dir, scm, dvc, run_copy):
|
||||
# view should include the specific target, parent dirs, and children
|
||||
# view should exclude any siblings of the target
|
||||
view = index.targets_view("dir/subdir")
|
||||
|
||||
assert view.data_keys == {
|
||||
"repo": {
|
||||
("dir", "subdir"),
|
||||
}
|
||||
}
|
||||
|
||||
data_index = view.data["repo"]
|
||||
assert ("dir",) in data_index
|
||||
assert (
|
||||
|
||||
Reference in New Issue
Block a user