Skip to content

Commit d41bbf2

Browse files
committed
fix cases
1 parent ca6756f commit d41bbf2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

R/bmerge.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ bmerge = function(i, x, icols, xcols, roll, rollends, nomatch, mult, ops, verbos
8888
set(i, j=ic, value=match.fun(paste0("as.", x_merge_type))(i[[ic]]))
8989
next
9090
}
91-
else if (anyNA(x[[xc]]) && allNA(x[[xc]])) {
91+
if (anyNA(x[[xc]]) && allNA(x[[xc]])) {
9292
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)
9393
set(x, j=xc, value=match.fun(paste0("as.", i_merge_type))(x[[xc]]))
9494
next
@@ -115,7 +115,7 @@ bmerge = function(i, x, icols, xcols, roll, rollends, nomatch, mult, ops, verbos
115115
xc_idx = xcols[ic_idx]
116116
for (b in which(vapply_1c(x[0L, ..xc_idx], getClass) == "double")) {
117117
xb = xcols[b]
118-
if (!isReallyReal(x[[xb]])) {
118+
if (isReallyReal(x[[xb]])) {
119119
coerce_x = FALSE
120120
break
121121
}

inst/tests/tests.Rraw

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20611,9 +20611,9 @@ test(2297.03, options=c(datatable.verbose=TRUE), y[x, on=.(c == a, d == a)], dat
2061120611
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")
2061220612
x = data.table(a=1)
2061320613
y = data.table(c=1, d=1L)
20614-
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")
20615-
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")
20614+
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")
20615+
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")
2061620616
x = data.table(a=d_dbl)
2061720617
y = data.table(c=d_dbl, d=d_int)
20618-
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")
20619-
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")
20618+
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")
20619+
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 commit comments

Comments
 (0)