Open francoispichot1 opened 1 year ago
Not able to reproduce with older or newer versions. @francoispichot1 Could you give a new version a try and see if you still have the same problem?
Correction, I can indeed reproduce, but got confused by description.
We are also experiencing this problem
Bug Report
Description
With a current working directory being a subdirectory of a dvc repository root directory, trying to open a file with
dvc.api.open('path_relative_to_root_directory', repo='path_to_repository')
fails with aFileMissingError
.Reproduce
test
test/titi.txt
dvc add test && dvc push
cd test
with open(path='test/titi.txt', repo='path_to_repository') as file: print(file.read())
Expected
As I provide the
repository
path to theopen
method, I expect the method to understand that the relative path provided is relative to the repository root directory and not to the current working directory. By the way, this is highlighted in the documentation:Overall, I believe that path handling should be reworked as the API is really unclear on this at the moment. Indeed, there is no documentation on how the paths are being handled by the
open
method based on their nature, to my mind, it could be something like this:open
method'srepo
parameter or relative to the current working directory otherwiseEnvironment information
Output of
dvc doctor
: