Skip to content

Commit 71ac34a

Browse files
Revert "Don't warn about numeric coercion in set(j=)"
This reverts commit f6c1385.
1 parent f6c1385 commit 71ac34a

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

NEWS.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ rowwiseDT(
133133
134134
8. `measurev()` was implemented and documented in v1.15.0, for use within `melt()`, and it is now exported (dependent packages can now use without a NOTE from CRAN check).
135135
136-
9. Using a double vector in `set()`'s `j=` no longer throws a warning about preferring integer, [#6594](https://github.com/Rdatatable/data.table/issues/6594). While it may improve efficiency to use integer, there's no guarantee it's an improvement and the difference is likely to be minimal. The coercion will still be reported under `datatable.verbose=TRUE`. For package/production use cases, static analyzers such as `lintr::implicit_integer_linter()` can also report when numeric literals should be rewritten as integer literals.
137-
138136
# data.table [v1.16.0](https://github.com/Rdatatable/data.table/milestone/30) (25 August 2024)
139137
140138
## BREAKING CHANGES

src/assign.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,7 @@ SEXP assign(SEXP dt, SEXP rows, SEXP cols, SEXP newcolnames, SEXP values)
425425
} else {
426426
if (isReal(cols)) {
427427
cols = PROTECT(coerceVector(cols, INTSXP)); protecti++;
428-
if (verbose)
429-
Rprintf(_("Coerced j from numeric to integer. Please pass integer for efficiency; e.g., 2L rather than 2"));
428+
warning(_("Coerced j from numeric to integer. Please pass integer for efficiency; e.g., 2L rather than 2"));
430429
}
431430
if (!isInteger(cols))
432431
error(_("j is type '%s'. Must be integer, character, or numeric is coerced with warning."), type2char(TYPEOF(cols)));

0 commit comments

Comments
 (0)