Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trivial (temporary?) fix for confusing list column printing, related,… #2562

Merged
merged 3 commits into from
Jan 11, 2018

Conversation

MichaelChirico
Copy link
Member

… part of #1523

There's some more discussion on the merits of instead using toString here which I tend to like, see the discussion on #1523; filing this PR to jumpstart that convo & offer a temporary fix in any case since this was trivial to do.

Also brought is.formula into print.data.table.R since that's where it belongs. Side note -- shouldn't the function instead be inherits(x, 'formula')?

@@ -145,3 +145,6 @@ shouldPrint = function(x) {
# for removing the head (column names) of matrix output entirely,
# as opposed to printing a blank line, for excluding col.names per PR #1483
cut_top = function(x) cat(capture.output(x)[-1L], sep = '\n')

# FR #2591 - format.data.table issue with columns of class "formula"
is.formula <- function(x) class(x) == "formula"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^shouldn't this be inherits(x, 'formula')?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Good spot. I'm about to merge so I'll do it quickly.

@codecov-io
Copy link

codecov-io commented Jan 10, 2018

Codecov Report

Merging #2562 into master will increase coverage by 0.14%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2562      +/-   ##
==========================================
+ Coverage   91.45%   91.59%   +0.14%     
==========================================
  Files          63       63              
  Lines       12071    12184     +113     
==========================================
+ Hits        11039    11160     +121     
+ Misses       1032     1024       -8
Impacted Files Coverage Δ
R/data.table.R 97.17% <ø> (-0.01%) ⬇️
R/print.data.table.R 98.09% <100%> (ø) ⬆️
src/assign.c 96.3% <0%> (+1.98%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f1d10c5...745e786. Read the comment docs.

…hould be minimal ideally) -- in this case, just the ... added is now more clear in the diff. Formatting changes can be made but if so, separately in a non-logic-change PR. If we elongated all tests like this then the lines of test code would expland dramatically. I also tend to press F5 in dev to run subsections of tests which is one reason I like dense.
Copy link
Member Author

@MichaelChirico MichaelChirico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough, don't disagree

@mattdowle mattdowle added this to the v1.10.6 milestone Jan 11, 2018
@mattdowle
Copy link
Member

Agree with adding ... after comma though. Better and clearer. And good spot on lack of inherits.

@MichaelChirico
Copy link
Member Author

all the same I think it's a holdover until we hash out the right way of incorporating toString which seems better for the goal of printing... the first 6 elements is probably accurate most of the time, but I think toString offers appropriate flexibility

@mattdowle
Copy link
Member

Yep - toString sounds good with a width for the column I guess, rather than fixed 6 items which can result in varying width. As long as separator is space-free "," rather than ", "! I can't see a way to change that in toString.

@mattdowle mattdowle merged commit 07d211c into master Jan 11, 2018
@mattdowle mattdowle deleted the printListQuickFix branch January 11, 2018 01:34
@MichaelChirico
Copy link
Member Author

MichaelChirico commented Jan 11, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants