Commit Graph
8 Commits
Author SHA1 Message Date
Paweł Redzyński d2f8cb0520 api: open scm controlled files (#2566)
* tree: make open method use mode and encoding

* api: try to open using self.tree if output not found

* repo: rename OutputMissingException

* test: api: test adding not cached output

* api: open: exists test instead of try

* repo: open: try opening from tree first

* repo: open: handle missing and not cached files

* repo: open: separate find out logic from opening
2019-10-08 15:23:42 +03:00
Alexander Schepanovski 85289ad00b api: wrap not found errors
api.open()/read() will now raise OutputFileMissingError and
Remote*.open() will raise FileNotFoundError if target file is absent.
2019-08-15 23:20:48 +07:00
Alexander Schepanovski 60a983b63f api: stream api.open() for local, SSH and HDFS 2019-08-13 18:19:52 +07:00
Alexander Schepanovski 9ba54c1f56 dvc: add rev param to api.open()/read()/get_url() 2019-07-01 14:40:48 +07:00
Alexander Schepanovski 3187040fe8 dvc: raise when Repo.open() fails 2019-07-01 14:40:48 +07:00
Alexander Schepanovski 4d248b4183 dvc: support external repos in api functions 2019-06-25 13:08:03 +07:00
Alexander Schepanovski d80293c44d dvc: path info refactoring
Replaced Path* dataclasses with PathInfo/URLInfo/CloudURLInfo, which
know how parse, serialize, stringify and join themselves. They also
provide useful accessors like part of an url or pathlib.Path like
.parent or .name.

Along the way two families of bugs where fixed and should never occur in
the future:
- paths not matched as strings anymore, e.g. using str.startswith()
- Output.path is eliminated as ambiguous

Both families might had caused undefined surprising behavior when local
and remote paths clash.
2019-06-11 19:19:17 +07:00
Alexander Schepanovski ca93dbcf13 dvc: add get_url()/open() API
As a part of this:
- DataCloud._cloud was refactored into `.get_remote()`
- data stopped using internal _cloud
- added a parametrization for remote tests
2019-05-27 17:56:31 +07:00