diffdf icon indicating copy to clipboard operation
diffdf copied to clipboard

update print message

Open kieranjmartin opened this issue 6 years ago • 6 comments

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

kieranjmartin avatar Aug 08 '18 14:08 kieranjmartin

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    
  ------------------------------------

gowerc avatar Mar 25 '19 14:03 gowerc

Oh that probably is better, yes

kieranjmartin avatar Mar 25 '19 14:03 kieranjmartin

from #9 - Update column names to be easier on the eyes i.e. Base and Compare

gowerc avatar Mar 25 '19 15:03 gowerc

@kieranjmartin , A couple of other enhancements I was thinking about:

  1. On the print out we should display all the options that were selected

  2. 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:

gowerc avatar Mar 26 '19 08:03 gowerc

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

kieranjmartin avatar Jun 21 '19 10:06 kieranjmartin

I added in my first attempt at this in https://github.com/gowerc/diffdf/commit/63a21d982fe09adc7e0f2171dd124d49df4d8421

image

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)

gowerc avatar Jul 21 '19 10:07 gowerc

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.

gowerc avatar Jul 29 '24 14:07 gowerc