Skip to content

Restore heeding option datatable.showProgress if set#2785

Merged
mattdowle merged 4 commits intomasterfrom
handle-showProgress-option
Apr 27, 2018
Merged

Restore heeding option datatable.showProgress if set#2785
mattdowle merged 4 commits intomasterfrom
handle-showProgress-option

Conversation

@HughParsonage
Copy link
Copy Markdown
Member

@HughParsonage HughParsonage commented Apr 23, 2018

Matt, I wasn't sure whether showProgress must be FALSE if interactive() is also FALSE

@HughParsonage HughParsonage requested a review from mattdowle April 23, 2018 04:30
@jangorecki
Copy link
Copy Markdown
Member

jangorecki commented Apr 23, 2018

Why not

getOption("datatable.showProgress", interactive())

I used that option sometimes, only to FALSE :)

@codecov-io
Copy link
Copy Markdown

codecov-io commented Apr 23, 2018

Codecov Report

Merging #2785 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2785   +/-   ##
=======================================
  Coverage   93.49%   93.49%           
=======================================
  Files          61       61           
  Lines       12367    12367           
=======================================
  Hits        11562    11562           
  Misses        805      805
Impacted Files Coverage Δ
R/fwrite.R 100% <ø> (ø) ⬆️
R/fread.R 96.87% <ø> (ø) ⬆️

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 3deeb38...083d7be. Read the comment docs.

@HughParsonage
Copy link
Copy Markdown
Member Author

@jangorecki Yes, that might be better. I just wasn't sure how deliberate the decision to remove the option was, or whether interactive() should trump the option. I seem to remember this change caused quite a lot of difficulty, so I wanted to keep the change minimal with respect to the current dev.

@MichaelChirico
Copy link
Copy Markdown
Member

MichaelChirico commented Apr 23, 2018 via email

@HughParsonage
Copy link
Copy Markdown
Member Author

6342551

@MichaelChirico
Copy link
Copy Markdown
Member

Hmm, I don't see anything there or in linked #2070 suggesting the need for the argument change

@bogind
Copy link
Copy Markdown

bogind commented Apr 27, 2018

I just uploaded a fix to the easycsv functions that use fread.
It should work even after the update.
if it won't you may feel free to contribute there, easycsv is relatively small and simple and as far as i'm concerned any help is welcome.

@mattdowle
Copy link
Copy Markdown
Member

Thanks all for efforts here. I don't recall why I dropped that option. And as you found too, I can't see anything in the history either. Did I change showProgress default around the same time that I (erroneously) thought that the fread multi-threaded crash in RStudio was to do with the progress bar? Anyway, @jangorecki's suggestion looks best to me. I may have been motivated at the time to remove options because of the overhead of getOption() when called a lot in a loop. But that's not a concern for fread/fwrite and also, more recent efforts to improve getOption speed in R itself have been largely successful. So the default argument being a call to getOption including default=interactive() directly there is clearest and most helpful to users. I don't anticipate any disagreement given the comments above so I'll change now and merge.

@mattdowle
Copy link
Copy Markdown
Member

mattdowle commented Apr 27, 2018

With my change just now, current CRAN version of easycsv will break again. Because it calls getOption("datatable.showProgress") which returns NULL and I've taken away the branch Hugh added to accept NULL. I've done this because @bogind has kindly written above that they have changed easycsv. Changing easycsv in this case is the best thing to do because data.table is unusual for setting options to a default value when data.table loads, so packages should not assume that by using getOption() without passing default=. This brings us into line with correct and common usage of getOption(). The main thing is that args(fread) and ?fread are now very clear how showProgress is set and what the default is. The argument and its default are checked by R CMD check to be consistent in fread.R and fread.Rd, too.
The easycsv update is unlikely to be accepted by CRAN until data.table has been updated there first. What I usually do is provide CRAN a list of packages that will break and let them know communication has happened and that those maintainers are prepared and ok to submit their updates afterwards. I hope this is ok @bogind. Many thanks.

@mattdowle mattdowle changed the title Provide backwards-compatibility for easycsv Restore datatable.showProgress if set Apr 27, 2018
@mattdowle mattdowle changed the title Restore datatable.showProgress if set Restore option datatable.showProgress if set Apr 27, 2018
@mattdowle mattdowle merged commit 1423e87 into master Apr 27, 2018
@mattdowle mattdowle deleted the handle-showProgress-option branch April 27, 2018 21:21
@mattdowle mattdowle added this to the v1.11.0 milestone Apr 27, 2018
@mattdowle mattdowle changed the title Restore option datatable.showProgress if set Restore heeding option datatable.showProgress if set Apr 27, 2018
@mattdowle
Copy link
Copy Markdown
Member

Same applies for package SIRItoGTFS, if that's ok with you @bogind?

@bogind
Copy link
Copy Markdown

bogind commented Apr 28, 2018

@mattdowle fine with me.
it will get a fix too in the next couple of days.

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.

6 participants