The root of this issue is that status is using one method to read bodies: mkDec(f).Decode(cmp); (see here) while diff is using two different methods, the first is r.Get(getp, res) where r is DatasetRequests (see here) while the second is using data, err = allCSVRows(file) (see here) which uses the go package "enconding/csv". Get returns the first row as "one","two",3.0 since it is forcing the json format to read the body, while the "encoding/csv" packages returns the first row as "one","two","3".
Ideally, we'd prefer that lib/diff would read these bodies as EntryReaders, but deepdiff doesn't support passing EntryReaders as the sources to diff. What would be nice is if deepdiff could add it's own lazy iterator interface that would match or adapt what EntryReader is doing. For now, we can just slurp both bodies into arrays and then pass them into deepdiff. As long as this slurping uses the same schema, both bodies should produce an empty diff.
With a saved version for an FSI linked dataset, using a csv body, and a clean working directory, running
qri status
gives:But
qri diff
gives:The csv body in this case is:
The root of this issue is that
status
is using one method to read bodies:mkDec(f).Decode(cmp);
(see here) whilediff
is using two different methods, the first isr.Get(getp, res)
where r isDatasetRequests
(see here) while the second is usingdata, err = allCSVRows(file)
(see here) which uses the go package "enconding/csv". Get returns the first row as"one","two",3.0
since it is forcing the json format to read the body, while the "encoding/csv" packages returns the first row as"one","two","3"
.Ideally, we'd prefer that lib/diff would read these bodies as EntryReaders, but deepdiff doesn't support passing EntryReaders as the sources to diff. What would be nice is if deepdiff could add it's own lazy iterator interface that would match or adapt what EntryReader is doing. For now, we can just slurp both bodies into arrays and then pass them into deepdiff. As long as this slurping uses the same schema, both bodies should produce an empty diff.