Dvc: Fix error message for dvc metrics show -a

Created on 25 Jan 2019  路  4Comments  路  Source: iterative/dvc

Ubuntu 16.04, pip install, version 0.24.2, python 3.6.4

The following happens because the metrics.auc file has not been added + committed to git:

rm -rf tmp
mkdir tmp
cd tmp
git init
dvc init
dvc run -M metrics.auc -f metrics.dvc 'echo "AUC: 0.9" > metrics.auc'

# Returns
dvc metrics show
# master:
#   metrics.auc: AUC: 0.9


# Returns an error:
# Error: unexpected error - Cmd('git') failed due to: exit code(1)
#   cmdline: git checkout master
#   stderr: 'error: pathspec 'master' did not match any file(s) known to git'
dvc metrics show -a

It would be useful to tell the user to add + commit the files to the SCM.

bug

Most helpful comment

Same issue here, but no error message. If you did not commit your accuracy metric file, dvc metrics show -a cannot switch branch, and displays equal metrics for all branches. Most clear from example:

image

dvc metrics show -a seem to work by using git checkout <branch>. If it cannot switch, it should display the git error message.

All 4 comments

Hi @tdeboissiere !

Great catch! We could just try to handle that empty repo case more gracefully. add and commit message is printed by the run command, but it is clearly not enough.

Related to https://github.com/iterative/dvc/issues/1009 .

Same issue here, but no error message. If you did not commit your accuracy metric file, dvc metrics show -a cannot switch branch, and displays equal metrics for all branches. Most clear from example:

image

dvc metrics show -a seem to work by using git checkout <branch>. If it cannot switch, it should display the git error message.

@timvink Thanks for the feedback! This issue is related to https://github.com/iterative/dvc/issues/1009 and will be fixed by using git show branch:file instead of doing git checkout.

Fixed by https://github.com/iterative/dvc/pull/1709 . Fix is already released, please feel free to upgrade. Thanks for the feedback guys! :slightly_smiling_face:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dmpetrov picture dmpetrov  路  3Comments

shcheklein picture shcheklein  路  3Comments

mdscruggs picture mdscruggs  路  3Comments

siddygups picture siddygups  路  3Comments

GildedHonour picture GildedHonour  路  3Comments