Skip to content

metrics show/diff: should it pick up untracked changes? [qa] #3607

@jorgeorpinel

Description

@jorgeorpinel
λ dvc version
DVC version: 0.92.0
Python version: 3.7.5
Platform: Windows-10-10.0.18362-SP0
Binary: True
Package: exe

# In a DVC repo:
λ echo 3 > metric
λ dvc add metric
λ dvc metrics add metric
λ dvc metrics show  # DOES shows uncommitted metric value
        metric: 3
λ dvc metrics diff  # Same
 Path    Metric   Value         Change
metric            3       diff not supported
λ git commit -m 'add raw metric'

λ echo 4 > metric
λ dvc metrics show  # Does NOT show uncommitted change
        metric: 3
λ dvc metrics diff  # Same...
No changes.

This is because the change in file metric hasn't been committed to cache, I guess. But it feels intuitive that show/diff would read the actual file in the workspace and not the cached one (at least diff? same as in Git).

We may have gone over this scenario before during the original PR so apologies if I'm going back to a solved discussion, just want to make sure it's not a bug.

To show the change, you have to

λ dvc commit -f metric.dvc
λ dvc metrics show
        metric: 4
λ dvc metrics diff
 Path    Metric   Value   Change
metric            4       1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDid we break something?

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions