You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Activate 5 more linters, including return_linter (#6128)
* missing_argument_linter and return_linter
* add scalar_in_linter
* nzchar_linter too
* errant character
* errant character was masking more lints; fixed
* correct error message in test
* fix test, use nolint
* remove overly-cautious keepNA=TRUE
else stopf("i evaluates to a logical vector length %d but there are %d rows. Recycling of logical i is no longer allowed as it hides more bugs than is worth the rare convenience. Explicitly use rep(...,length=.N) if you really need to recycle.", length(i), nrow(x))
619
619
} else {
620
620
irows= as.integer(i) # e.g. DT[c(1,3)] and DT[c(-1,-3)] ok but not DT[c(1,-3)] (caught as error)
621
-
if (nomatch0) warning("Please use nomatch=NULL instead of nomatch=0; see news item 5 in v1.12.0 (Jan 2019)")
621
+
if (nomatch0) warningf("Please use nomatch=NULL instead of nomatch=0; see news item 5 in v1.12.0 (Jan 2019)")
622
622
# warning only for this case where nomatch was ignored before v1.14.2; #3109
msg= gettextf('na.strings[%d]=="%s" consists only of whitespace, ignoring', tt[1L], na.strings[tt[1L]])
155
155
if (strip.white) {
156
-
if (any(na.strings=="")) {
157
-
warningf('%s. strip.white==TRUE (default) and "" is present in na.strings, so any number of spaces in string columns will already be read as <NA>.', msg)
158
-
} else {
156
+
if (all(nzchar(na.strings))) {
159
157
warningf('%s. Since strip.white=TRUE (default), use na.strings="" to specify that any number of spaces in a string column should be read as <NA>.', msg)
158
+
} else {
159
+
warningf('%s. strip.white==TRUE (default) and "" is present in na.strings, so any number of spaces in string columns will already be read as <NA>.', msg)
warningf("Column '%s' was requested to be '%s' but fread encountered the following %s:\n\t%s\nso the column has been left as type '%s'", names(ans)[j], new_class, if (inherits(e, "error")) "error"else"warning", e$message, typeof(v))
320
-
return(v)
320
+
v
321
321
},
322
322
error=fun)
323
323
set(ans, j=j, value=new_v) # aside: new_v == v if the coercion was aborted
0 commit comments