From 8b28a268e8f9095633cc8e3a63d73dfdfbf124d6 Mon Sep 17 00:00:00 2001 From: Frederik Schubert Date: Fri, 9 Oct 2020 23:05:18 +0200 Subject: [PATCH] remote: set dependency name for WebDAV (#4691) When executing `dvc import-url remote://some-webdav/data`, the name of the WebDAV dependency in the created stage for data used to be `None`. This resulted in the following error: ``` Traceback (most recent call last): File "/home/schubert/projects/dvc/dvc/main.py", line 76, in main ret = cmd.run() File "/home/schubert/projects/dvc/dvc/command/imp_url.py", line 14, in run self.repo.imp_url( File "/home/schubert/projects/dvc/dvc/repo/__init__.py", line 51, in wrapper return f(repo, *args, **kwargs) File "/home/schubert/projects/dvc/dvc/repo/scm_context.py", line 4, in run result = method(repo, *args, **kw) File "/home/schubert/projects/dvc/dvc/repo/imp_url.py", line 54, in imp_url stage.run() File "/home/schubert/miniconda3/tmp/envs/some-project/lib/python3.8/site-packages/funcy/decorators.py", line 39, in wrapper return deco(call, *dargs, **dkwargs) File "/home/schubert/projects/dvc/dvc/stage/decorators.py", line 36, in rwlocked return call() File "/home/schubert/miniconda3/tmp/envs/some-project/lib/python3.8/site-packages/funcy/decorators.py", line 60, in __call__ return self._func(*self._args, **self._kwargs) File "/home/schubert/projects/dvc/dvc/stage/__init__.py", line 450, in run self.save() File "/home/schubert/projects/dvc/dvc/stage/__init__.py", line 395, in save self.md5 = self.compute_md5() File "/home/schubert/projects/dvc/dvc/stage/__init__.py", line 388, in compute_md5 m = compute_md5(self) File "/home/schubert/projects/dvc/dvc/stage/utils.py", line 167, in compute_md5 return dict_md5( File "/home/schubert/projects/dvc/dvc/utils/__init__.py", line 118, in dict_md5 return dict_hash(d, "md5", **kwargs) File "/home/schubert/projects/dvc/dvc/utils/__init__.py", line 113, in dict_hash byts = json.dumps(filtered, sort_keys=True).encode("utf-8") File "/home/schubert/miniconda3/tmp/envs/some-project/lib/python3.8/json/__init__.py", line 234, in dumps return cls( File "/home/schubert/miniconda3/tmp/envs/some-project/lib/python3.8/json/encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "/home/schubert/miniconda3/tmp/envs/some-project/lib/python3.8/json/encoder.py", line 257, in iterencode return _iterencode(o, 0) TypeError: '<' not supported between instances of 'str' and 'NoneType' ``` --- dvc/tree/webdav.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dvc/tree/webdav.py b/dvc/tree/webdav.py index 9bb270517..8f7402674 100644 --- a/dvc/tree/webdav.py +++ b/dvc/tree/webdav.py @@ -42,6 +42,8 @@ class WebDAVTree(BaseTree): # pylint:disable=abstract-method # Chunk size for buffered upload/download with progress bar CHUNK_SIZE = 2 ** 16 + PARAM_CHECKSUM = "etag" + # Constructor def __init__(self, repo, config): # Call BaseTree constructor