Skip to content

params diff: problems with file types #5186

@jorgeorpinel

Description

@jorgeorpinel

Bug Report

Found during treeverse/dvc.org#2062 (review)

Description

params diff assumes file content types.

Reproduce

In a fresh DVC repo:

$ echo "foo: 1" > params.yaml
$ echo "bar: 2" > params.json  # YAML file with json extension

$  dvc params diff
Path         Param    Old    New
params.yaml  foo      —      1
$ dvc params diff --targets params.json  # (1) First inconsistency
WARNING: 'params.json' was not found at: 'HEAD'.

$ git add --all
$ git commit -m "add 2 params files"

$ echo "foo: 2" > params.yaml
$ echo "bar: 4" > params.json

$ dvc params diff
Path         Param    Old    New
params.yaml  foo      1      2
$ dvc params diff --targets params.json  # (2) 2nd (main) problem
# No output

Expected

dvc params diff to tell me why nothing is displayed for params.json.

Environment information

Output of dvc version:

$ dvc version
DVC version: 1.11.0+6fcafc
---------------------------------
Platform: Python 3.6.9 on Linux-4.19.128-microsoft-standard-x86_64-with-Ubuntu-18.04-bionic
Supports: All remotes
Cache types: <https://error.dvc.org/no-dvc-cache>
Caches: local
Remotes: None
Workspace directory: ext4 on /dev/sdb
Repo: dvc, git

Additional Information (if any):

Metadata

Metadata

Assignees

No one assigned

    Labels

    A: paramsRelated to dvc paramsenhancementEnhances DVCuiuser interface / interaction

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions