diffdf
diffdf copied to clipboard
update print message
I think on balance including "All rows are shown in table below" is unecessary, and we should only point out where this isn't the case
related:
Do you think the variable
column in the print method is redundant ? how about instead of
============================================
VARIABLE ..ROWNUMBER.. BASE COMPARE
--------------------------------------------
Sepal.Length 1 5.1 1
Sepal.Length 2 4.9 4
Sepal.Length 3 4.7 9
--------------------------------------------
we could have
Column: Sepal.Length
====================================
..ROWNUMBER.. BASE COMPARE
------------------------------------
1 5.1 1
2 4.9 4
3 4.7 9
------------------------------------
Oh that probably is better, yes
from #9 - Update column names to be easier on the eyes i.e. Base
and Compare
@kieranjmartin , A couple of other enhancements I was thinking about:
-
On the print out we should display all the options that were selected
-
On the summary section we should display what tests were performed and whether they passed or not (this can also be something that is dynamically printed when the object is being run/build which can be switched off with a
quiet = TRUE
option) i.e.
Checking for distinct keys.......................Pass
Checking columns in base are in compare..........Pass
Checking columns in compare are in base..........Fail
Checking rows in base are in compare.............Pass
Checking rows in compare are in base.............Pass
Checking column order is the same.........Not checked
Checking row order is the same...................Pass
Checking column attributes match.................Pass
Checking column types match......................Pass
Checking values match............................Fail
Warning: Not all test succeeded, see below for details:
Ah yes I like that, similar to what testthat does. I think modern testthat print actually looks like the build print which is pretty cool.
We could also consider the use of crayon for something like to highlight failed tests
I added in my first attempt at this in https://github.com/gowerc/diffdf/commit/63a21d982fe09adc7e0f2171dd124d49df4d8421
It needs a fair bit more work yet (especially around checking for values as currently the message doesn't display until after they've been checked) but just thought i'd share for some initial feedback. I also still need to do the dropping of the "VARIABLE" columns but I think that will be done as part of a wider overhaul of the print method (along with html tables)
This issue is a bit of a mess. I'm going to close it (as the original request has now been implemented) but then open up separate issues for the multiple other ideas here.