-
Notifications
You must be signed in to change notification settings - Fork 5
style: use glue for line-wrapping in cache warnings #191
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -252,12 +252,12 @@ cache_epidata_call <- function(epidata_call, fetch_args = fetch_args_list()) { | |
if (as_of_recent || issues_recent) { | ||
cli::cli_warn( | ||
c( | ||
"using cached results with `as_of` within the past week (or the future!).", | ||
"This will likely result in an invalid cache. Consider\n", | ||
"1. disabling the cache for this session with `disable_cache` or permanently with environmental ", | ||
"variable `EPIDATR_USE_CACHE=FALSE`\n", | ||
"2. setting `EPIDATR_CACHE_MAX_AGE_DAYS={Sys.getenv('EPIDATR_CACHE_MAX_AGE_DAYS', unset = 1)}`", | ||
" to e.g. `3/24` (3 hours)." | ||
"Using cached results with `as_of` within the past week (or the future!). | ||
This will likely result in an invalid cache. Consider", | ||
"i" = "disabling the cache for this session with `disable_cache` or | ||
permanently with environmental variable `EPIDATR_USE_CACHE=FALSE`", | ||
"i" = "setting `EPIDATR_CACHE_MAX_AGE_DAYS={Sys.getenv('EPIDATR_CACHE_MAX_AGE_DAYS | ||
', unset = 1)}` to e.g. `3/24` (3 hours)." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. todo: This rendered as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that was intended, to show the current value? though it does look like github is treating the ` strangely. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe we reword it for clarity?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. slight tweak, maybe (btw, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it might also benefit from some extra explanation what it's doing, making sure that they receive any new versions of versions quickly (but with better wording) |
||
), | ||
.frequency = "regularly", | ||
.frequency_id = "cache timing issues", | ||
|
@@ -267,8 +267,8 @@ cache_epidata_call <- function(epidata_call, fetch_args = fetch_args_list()) { | |
if (!is.key_missing(cached)) { | ||
cli::cli_warn( | ||
brookslogan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
c( | ||
"loading from the cache at {cache_environ$epidatr_cache$info()$dir}; ", | ||
"see {cache_environ$epidatr_cache$info()$logfile} for more details." | ||
"Loading from the cache at {cache_environ$epidatr_cache$info()$dir}; | ||
see {cache_environ$epidatr_cache$info()$logfile} for more details." | ||
), | ||
.frequency = "regularly", | ||
.frequency_id = "using the cache", | ||
|
@@ -277,7 +277,6 @@ cache_epidata_call <- function(epidata_call, fetch_args = fetch_args_list()) { | |
return(cached[[1]]) | ||
} | ||
} | ||
'which was saved on {format(cached[[2]],"%A %B %d, %Y")}, which took {round(cached[[3]][[3]], digits=5)} seconds.' | ||
# need to actually get the data, since its either not in the cache or we're not caching | ||
runtime <- system.time(if (epidata_call$only_supports_classic) { | ||
fetched <- fetch_classic(epidata_call, fetch_args) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment: "i" = is "info item", not numbered list, if that was what you were expecting. Here it might look prettier to use "*" for a bulleted list. (Not sure how to do an actual enumeration, but here just an unordered list seems more suitable.)