Skip to content

Commit

Permalink
fix cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-schwen committed Nov 27, 2024
1 parent ca6756f commit d41bbf2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions R/bmerge.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ bmerge = function(i, x, icols, xcols, roll, rollends, nomatch, mult, ops, verbos
set(i, j=ic, value=match.fun(paste0("as.", x_merge_type))(i[[ic]]))
next
}
else if (anyNA(x[[xc]]) && allNA(x[[xc]])) {
if (anyNA(x[[xc]]) && allNA(x[[xc]])) {
if (verbose) catf("Coercing all-NA %s (%s) to type %s to match type of %s.\n", xname, x_merge_type, i_merge_type, iname)
set(x, j=xc, value=match.fun(paste0("as.", i_merge_type))(x[[xc]]))
next
Expand All @@ -115,7 +115,7 @@ bmerge = function(i, x, icols, xcols, roll, rollends, nomatch, mult, ops, verbos
xc_idx = xcols[ic_idx]
for (b in which(vapply_1c(x[0L, ..xc_idx], getClass) == "double")) {
xb = xcols[b]
if (!isReallyReal(x[[xb]])) {
if (isReallyReal(x[[xb]])) {
coerce_x = FALSE
break

Check warning on line 120 in R/bmerge.R

View check run for this annotation

Codecov / codecov/patch

R/bmerge.R#L119-L120

Added lines #L119 - L120 were not covered by tests
}
Expand Down
8 changes: 4 additions & 4 deletions inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -20611,9 +20611,9 @@ test(2297.03, options=c(datatable.verbose=TRUE), y[x, on=.(c == a, d == a)], dat
test(2297.04, options=c(datatable.verbose=TRUE), y[x, on=.(d == a, c == a)], data.table(c=d_int, d=d_int), output="Coercing .*c to type double")
x = data.table(a=1)
y = data.table(c=1, d=1L)
test(2297.11, options=c(datatable.verbose=TRUE), y[x, on=.(c == a, d == a)], data.table(c=1, d=1), output="Coercing .*d to type double")
test(2297.12, options=c(datatable.verbose=TRUE), y[x, on=.(d == a, c == a)], data.table(c=1, d=1), output="Coercing .*d to type double")
test(2297.11, options=c(datatable.verbose=TRUE), y[x, on=.(c == a, d == a)], data.table(c=1L, d=1L), output="Coercing double column x.c (which contains no fractions) to type integer")
test(2297.12, options=c(datatable.verbose=TRUE), y[x, on=.(d == a, c == a)], data.table(c=1L, d=1L), output="Coercing double column x.c (which contains no fractions) to type integer")
x = data.table(a=d_dbl)
y = data.table(c=d_dbl, d=d_int)
test(2297.13, options=c(datatable.verbose=TRUE), y[x, on=.(c == a, d == a)], data.table(c=d_dbl, d=d_dbl), output="Coercing .*d to type double")
test(2297.14, options=c(datatable.verbose=TRUE), y[x, on=.(d == a, c == a)], data.table(c=d_dbl, d=d_dbl), output="Coercing .*d to type double")
test(2297.13, options=c(datatable.verbose=TRUE), y[x, on=.(c == a, d == a)], data.table(c=d_int, d=d_int), output="Coercing double column x.c (which contains no fractions) to type integer")
test(2297.14, options=c(datatable.verbose=TRUE), y[x, on=.(d == a, c == a)], data.table(c=d_int, d=d_int), output="Coercing double column x.c (which contains no fractions) to type integer")

0 comments on commit d41bbf2

Please sign in to comment.