iterative / dvc

🦉 ML Experiments and Data Management with Git
https://dvc.org
Apache License 2.0
13.36k stars 1.16k forks source link

add: raise DoesNotExistError only if the output path does not exist #10373

Closed skshetry closed 3 months ago

skshetry commented 3 months ago

dvc add command incorrectly raises a DoesNotExistError when a broken symlink exists in an output directory, and the target name is same as the directory's name.

eg: If data is an output, and the command is invoked as dvc add data (i.e. no virtual directory operations to perform).

The expected behavior is to raise a FileNotFoundError. DoesNotExistError should only be raised if the output itself does not exist.

Related: https://github.com/iterative/dvc/issues/3717

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.70%. Comparing base (3375a7c) to head (3888a6a).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #10373 +/- ## ======================================= Coverage 90.70% 90.70% ======================================= Files 501 501 Lines 38837 38837 Branches 5616 5616 ======================================= Hits 35229 35229 Misses 2964 2964 Partials 644 644 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.