Commit Graph
6080 Commits
Author SHA1 Message Date
Paweł Redzyński f6f18bc201 plots: make linear and scatter interactive (#4975) 2020-12-01 14:55:30 +01:00
Saugat Pachhai 3a3fa7cdde parametrization: convert bool to string as "true"/"false" (#5004)
Previously, Python's `str()` was being used that
resulted in boolean transformed into "True"/"False".

Fixes #4996
2020-12-01 16:05:18 +05:45
Saugat Pachhai 1e1a0999f6 parametrization: show interpolated vars in params diff (#5002)
* parametrization: show interpolated vars in params diff

* Add test for params.diff

* disable logging duration if feature is not enabled
2020-12-01 15:43:37 +05:45
Ruslan Kuprieiev 7f0537038c dvc: preserve desc on add/run/imp (#5003) 2020-12-01 11:52:31 +02:00
Ruslan Kuprieiev 7c45711e34 dvc: preserve comments/meta on add/imp/run (#5001) 2020-12-01 10:39:51 +02:00
Peter Rowlands (변기호) 1e52bc94a3 git: add support for working with refspecs and stashes (#4952)
* git: add support for dulwich Stash

* git: start adding support for custom refs

* git: add Stash and helper context managers for preserving
workspace state

* scm: cleanup refs/stash and add push_refspec

* tests: add tests for git refs and stash

* fix push_refspec

* tests: add tests for git push_refspec

* scm: add git fetch-refspecs

* add test for fetch refspecs

* scm: add test for git refs containing

* remove extraneous log msgs

* fix typing issues

* stash: only try to push if workspace is dirty

* update dulwich to 0.20.14

* scm: move dulwich into scm.backend

* move stash internals to backends

* scm: move git code into dvc/scm/git/... module

* git: use ABC for BaseGitBackend

* fix rebase issue

* git: fix refspec tests on windows

- git file:// URLs need posix style paths

* git: move get_refs_containing to backend

* scm: add callback for handling diverged refs during fetch
2020-12-01 16:56:50 +09:00
Artem Dudarev 38cbd998e1 dvc: more explict error during init when .dvc is ignored by git (#4978)
* dvc: more explict error during init when .dvc is ignored by git

Fixes #3738

* dvc: address PR feedback

* styling

* styling
2020-11-30 21:00:17 +02:00
Ruslan Kuprieiev 09a88b8ea6 stage: move is_cached logic to Stage.can_be_skipped (#4994)
Having that logic in `create_stage` is unnatural and also has some
side-effects for unsuspecting users. For example, it will check the
filesystem for existing dvcfile and will try to load a corresponding old
stage. I've adjusted it with minimal changes to better reflect the logic
behind it.

Pre-requisite for #4907
2020-11-30 15:11:35 +02:00
Saugat Pachhai bc1d10532a Move Repo.collect and collect_granular to Repo.stage (#4993) 2020-11-30 14:28:16 +05:45
Jorge Orpinel 56322d0a53 cmd: matching help output to docs (#4989)
* cmd: matching help output to docs
per https://github.com/iterative/dvc.org/pull/1971#pullrequestreview-538749492
and https://github.com/iterative/dvc.org/pull/1978#pullrequestreview-540445147

* fetch: simplify help text
per https://github.com/iterative/dvc.org/pull/1978#pullrequestreview-540447055
2020-11-30 09:09:11 +02:00
Saugat Pachhai f4f0554884 repro: support glob/foreach-group to run at once through CLI (#4976)
* repro: support regex/foreach-group to run at once

Fixes #4912
Fixes #4886
Fixes #4958

* Use `tree.isdir` rather than `os.path.isdir`

* Use glob rather than regex

* Update dvc/command/repro.py

* s/regex/glob

* disable glob on `collect_granular`

There's no need for a glob here

* add tests for `collect` and `collect_granular`
2020-11-27 19:13:38 +05:45
Saugat Pachhai 011bd18e9f parametrization: support loading vars partially (#4982) 2020-11-27 19:05:02 +05:45
Saugat Pachhai 6d745eb4f0 s3: use mocked s3 instead of the real one (#4968)
* s3: use mocked s3 instead of the real one

Not removing the fixtures just yet

* Update moto

Tests was failing, because of a change in `responses` package, which
`moto` was mocking. This was fixed on
https://github.com/spulec/moto/pull/3466 which is only available on
`dev122` release.

* Use mocked s3 in checkout tests
2020-11-26 11:30:43 +05:45
Saugat Pachhai 788d840e7d tests/ci: update docker image for Azurite (#4967)
`Azure` tests are flaky for some reason. When I investigated one
of the job [1], something seemed wrong with the Azurite or
the client lib.

On `AzureTree.blob_service`, we do the following to check if the
container exists:
```python
try:
    container_client.get_container_properties()
except ResourceNotFoundError:
    container_client.create_container()
```

When looking at the test log, I found out that the
`get_container_properties` was failing with
`ErrorCode:ContainerNotFound` whereas `create_container`
successively was failing with `ErrorCode:ContainerAlreadyExists`.

`create_container` is correct, but `get_container_properties` is
incorrect, as many of the Azure tests have already run successfully
before.

So, either the Azurite has/had bug or the client lib has a bug.
Anyway, we'll find out after updating the Azurite.

[1]: https://github.com/iterative/dvc/runs/1448864706#step:7:4029
2020-11-25 21:21:00 +02:00
Saugat Pachhai 7586c32d95 Remove libs used in pre-commit to avoid duplication (#4966) 2020-11-25 18:30:28 +05:45
Saugat Pachhai dcba0e8da4 pre-commit: update hooks (#4964) 2020-11-25 17:57:32 +05:45
Saugat Pachhai 1294450a46 parse: parse target correctly for generated stages (#4961) 2020-11-25 16:13:17 +05:45
Ruslan Kuprieiev c989b28eae dvc: bump to 1.10.2 1.10.2 2020-11-24 18:33:49 +02:00
Saugat Pachhai abb78ce19d parametrization: print pretty interpolation errors (#4953)
* parametrization: print pretty interpolation errors

* Fix col/loc in exception msg

* Fix tests
2020-11-24 18:26:26 +05:45
Saugat Pachhai bc4c9fe9ea parametrization: prevent dumping parametrized stages (#4950)
* parametrization: prevent dumping parametrized stages

This is a bit hackish, but does the job done.
It feels like we need some unified way to be able to load
and dump, but not sure how. Till then, this dataclass
will be helpful in communicating between those.

* s/Meta/RawData

* Update dvc/stage/loader.py
2020-11-24 17:40:47 +05:45
Saugat Pachhai d138bdd72a Add mypy config, fix type errors in a few remaining places (#4951)
* Add mypy config, fix type errors in a few random places

* Add typing_extensions

* Use setup.cfg for mypy's config
2020-11-24 14:19:55 +05:45
Saugat Pachhai 7c3c2e8123 Fix typechecking errors - 2 (#4946) 2020-11-24 11:18:11 +05:45
Saugat Pachhai 04c53601c0 types: add types to dvc/tree (#4947) 2020-11-24 11:16:28 +05:45
Saugat Pachhai 3ba70d375e types: fix type errors on dvc.collect (#4948) 2020-11-24 11:16:02 +05:45
Saugat Pachhai 85ad7358d9 types: fix type checking errors in dvc.experiments (#4949) 2020-11-24 07:22:42 +05:45
Saugat Pachhai cb56f57908 Fix typechecking errors around a few places (#4945) 2020-11-23 19:00:45 +05:45
Saugat Pachhai a7a007e4f9 Fix typechecking errors in dvc/repo (#4944) 2020-11-23 17:27:04 +05:45
Saugat Pachhai e33274723d Move flags from tests to config (#4943) 2020-11-23 16:21:24 +05:45
Saugat Pachhai f1efc8f409 tests: increase ulimit to 4096 (#4942) 2020-11-23 11:22:15 +02:00
Saugat Pachhai 1a2c91eb5a Use PathStringTrie consistently (#4941)
This one was missed for some reason.
2020-11-23 12:44:43 +05:45
Saugat Pachhai 806f8032d9 ci: reduce no. of MacOS jobs (#4940)
This was increasing the wait times of the CI.

Also enabled codecov failure to not fail the whole CI pipeline.
2020-11-23 12:12:58 +05:45
Saugat Pachhai 8cb4202292 Fix metadata tests running with module-scoped fixtures (#4939)
I ran it this way before, to make it run fast. But, it's not ideal
for running with xdist.
2020-11-23 11:45:45 +05:45
Saugat Pachhai 5faae2a6e9 test: allow selectively running tests for remotes (#4920)
Some of the tests are run by default, other requires
`--enable-{remote}` to run. The remotes that are run by default
also have a `--disable-{remote}` flag. All of the remotes can be
enabled using `--all` flag.

To use this functionality in the fixture,
`test_config` fixture has to be used, and requires to call
`test_config.requires(remote)`.
In an individual test, you can simply use `pytest.mark.remote`
to make them skip or run.
2020-11-23 11:43:39 +05:45
Saugat Pachhai 6237a665c3 tests: indices syntax for parametrization (#4930) 2020-11-20 20:19:47 +05:45
Saugat Pachhai 011bd35a6c parametrization: change foreach stage name joiner from "-" to "@" (#4929) 2020-11-20 19:49:46 +05:45
Saugat Pachhai 133018af78 s/foreach..in/foreach..do (#4928) 2020-11-20 19:47:58 +05:45
Saugat Pachhai c65fdcabae tests: add error message tests for resolving stages (#4927) 2020-11-20 19:42:59 +05:45
Saugat Pachhai e1692a6be0 parametrization: improve error messages on foreach loop (#4926) 2020-11-20 18:54:12 +05:45
Saugat Pachhai c8f37fdb88 parsing: improve error messages when resolving keys of the stages (#4925) 2020-11-20 18:16:23 +05:45
Saugat Pachhai 7f66db7039 parametrization: improve 'vars' error message (#4924)
* Catches MergeError
* Catches params file not existing error
2020-11-20 17:46:34 +05:45
Saugat Pachhai 470f411cd6 parametrization: improve set error message (#4923) 2020-11-20 17:08:05 +05:45
Saugat Pachhai d721e919e4 parametrization: improve key error message (#4922) 2020-11-20 16:38:32 +05:45
Saugat Pachhai c03fbb0056 parametrization: raise appropriate error message on merge error (#4921) 2020-11-20 16:04:33 +05:45
Saugat Pachhai cb3e52829b interpolation: support [] indices syntax (#4918)
Via pyparsing. The error message is not that great, as it's greedy.
But, it does point out where the mistakes are, correctly most of the
time. :)

Also raises appropriate error messages for ParseError
2020-11-20 14:31:16 +05:45
Saugat Pachhai 4b7d130003 Skip already used vars, even if they are in a relative path (#4917)
Previously, "dir/../params.yaml" would have thrown an OverwriteError
2020-11-20 14:10:26 +05:45
Saugat Pachhai d5312e56a1 parametrization: Move resolver to StageLoader from Dvcfile (#4916) 2020-11-20 13:38:57 +05:45
Ruslan Kuprieiev 2a6c4291ce dag: support output as target (#4908)
Fixes #4904
2020-11-20 06:57:12 +02:00
Saugat Pachhai 40c3bbd1ba Change use and vars to just vars (#4880)
The schema is changed of `vars` to accomodate the both use of
`imports` and setting variables locally.

Now:
```
vars:
  - params.yaml
  - foo: foo
    bar: bar
```

Also, same distinction occurs for the stages.
2020-11-20 09:19:13 +05:45
Sami Jawhar 92b17e3a89 Fix exp checkout queued and cleanup (#4914) 2020-11-20 09:16:12 +09:00
Sami Jawhar 153c374c02 experiments: pop checkpoint resume from kwargs (#4913) 2020-11-20 09:12:13 +09:00