Skip to content

import-url: does not work for URL that contains a query string #3424

@shcheklein

Description

@shcheklein
(.env) [ivan@ivan ~/Projects/test-gs]$ dvc version
DVC version: 0.86.5+1f4fbf.mod
Python version: 3.7.6
Platform: Darwin-18.2.0-x86_64-i386-64bit
Binary: False
Package: None
Cache: reflink - supported, hardlink - supported, symlink - supported
Filesystem type (cache directory): ('apfs', '/dev/disk1s1')
Filesystem type (workspace): ('apfs', '/dev/disk1s1')

dvc import-url -v https://www.dropbox.com/?test data

gets you:

2020-02-29 21:01:49,849 ERROR: unexpected error
------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/ivan/Projects/dvc/dvc/main.py", line 49, in main
    ret = cmd.run()
  File "/Users/ivan/Projects/dvc/dvc/command/imp_url.py", line 16, in run
    self.args.url, out=self.args.out, fname=self.args.file
  File "/Users/ivan/Projects/dvc/dvc/repo/__init__.py", line 28, in wrapper
    ret = f(repo, *args, **kwargs)
  File "/Users/ivan/Projects/dvc/dvc/repo/scm_context.py", line 4, in run
    result = method(repo, *args, **kw)
  File "/Users/ivan/Projects/dvc/dvc/repo/imp_url.py", line 20, in imp_url
    accompany_outs=True,
  File "/Users/ivan/Projects/dvc/dvc/stage.py", line 534, in create
    stage, kwargs.get("deps", []), erepo=kwargs.get("erepo", None)
  File "/Users/ivan/Projects/dvc/dvc/dependency/__init__.py", line 77, in loads_from
    ret.append(_get(stage, s, info))
  File "/Users/ivan/Projects/dvc/dvc/dependency/__init__.py", line 61, in _get
    return d(stage, p, info)
  File "/Users/ivan/Projects/dvc/dvc/output/base.py", line 101, in __init__
    self.path_info = self._parse_path(remote, path)
  File "/Users/ivan/Projects/dvc/dvc/output/base.py", line 109, in _parse_path
    return self.REMOTE.path_cls(path)
  File "/Users/ivan/Projects/dvc/dvc/path_info.py", line 115, in __init__
    assert not p.query and not p.params and not p.fragment
AssertionError
------------------------------------------------------------

Context: https://discordapp.com/channels/485586884165107732/485596304961962003/683485273085968424

Metadata

Metadata

Assignees

Labels

bugDid we break something?

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions