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

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

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

skshetry
Copy link
Member

@skshetry skshetry commented Mar 26, 2024

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: #3717

`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 is the command is invoked as `dvc add data`
(i.e. no virtual directory operations to perform).

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

Related: iterative#3717
@skshetry skshetry self-assigned this Mar 26, 2024
@skshetry skshetry enabled auto-merge (squash) March 26, 2024 10:57
Copy link

codecov bot commented Mar 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@           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           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@skshetry skshetry merged commit 5379aa2 into iterative:main Mar 26, 2024
20 checks passed
@skshetry skshetry deleted the improve-add-failure branch March 26, 2024 11:16
BradyJ27 pushed a commit to BradyJ27/dvc that referenced this pull request Apr 22, 2024
…terative#10373)

`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 is the command is invoked as `dvc add data`
(i.e. no virtual directory operations to perform).

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

Related: iterative#3717
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.

1 participant