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
* move verbosity to coerce_col, update tests
* do not match.fun as.integer64, pull 'factor' cond from cast_with_atts to coerce_col
* delint
* delint
* simplify coerce_col and cast_with_attrs further
* style+readability changes; attempt to fix possible mistaken use of from_detail=
* remove ()? in for join msgs
* fix arg name
* fully normalize useFancyQuotes
* Revert "fully normalize useFancyQuotes"
This reverts commit 8d50c3a.
* one-off handling of useFancyQuotes instead
---------
Co-authored-by: Michael Chirico <[email protected]>
Co-authored-by: Michael Chirico <[email protected]>
set(callersi, j=icol, value=i[[icol]]) # factor in i joining to character in x will return character and not keep x's factor; e.g. for antaresRead #3581
74
78
next
75
79
} elseif (i_merge_type=="character") {
76
80
if (verbose) catf("Matching character column %s to factor levels in %s.\n", iname, xname)
if (x_merge_type=="integer64") { w=i; wc=icol; wclass=i_merge_type; } else { w=x; wc=xcol; wclass=x_merge_type; nm=rev(nm) } # w is which to coerce
106
109
if (wclass=="integer"|| (wclass=="double"&& fitsInInt64(w[[wc]]))) {
107
-
if (verbose) catf("Coercing %s column %s%s to type integer64 to match type of %s.\n", wclass, nm[1L], if (wclass=="double") " (which has integer64 representation, e.g. no fractions)"else"", nm[2L])
108
-
set(w, j=wc, value=bit64::as.integer64(w[[wc]]))
110
+
from_detail=if (wclass=="double") gettext(" (which has integer64 representation, e.g. no fractions)")else""
} else stopf("Incompatible join types: %s is type integer64 but %s is type double and cannot be coerced to integer64 (e.g. has fractions)", nm[2L], nm[1L])
test(2044.61, dt1[dt2, ..cols, on="int==realDouble", verbose=TRUE], # this was wrong in v1.12.2 (the fractions were truncated and joined to next lowest int)
output="Coercing integer column i.date to type double for join to match type of x.date")
15645
+
output="Coercing integer column i.date .for join. to type double to match type of x.date")
15645
15646
15646
15647
# complex values in grouping, #3639
15647
15648
set.seed(42)
@@ -20688,8 +20689,8 @@ test(2296, d2[x %no such operator% 1], error = '%no such operator%')
20688
20689
# fix coercing integer/double for joins on multiple columns, #6602
20689
20690
x = data.table(a=1L)
20690
20691
y = data.table(c=1L, d=1)
20691
-
test(2297.01, y[x, on=.(c == a, d == a), verbose=TRUE], data.table(c=1L, d=1L), output="Coercing .*a to type double.*Coercing .*c to type double")
20692
-
test(2297.02, y[x, on=.(d == a, c == a), verbose=TRUE], data.table(c=1L, d=1L), output="Coercing .*a to type double.*Coercing .*c to type double")
20692
+
test(2297.01, y[x, on=.(c == a, d == a), verbose=TRUE], data.table(c=1L, d=1L), output="Coercing .*a .for join. to type double.*Coercing .*c to type double")
20693
+
test(2297.02, y[x, on=.(d == a, c == a), verbose=TRUE], data.table(c=1L, d=1L), output="Coercing .*a .for join. to type double.*Coercing .*c to type double")
20693
20694
x = data.table(a=1)
20694
20695
y = data.table(c=1, d=1L)
20695
20696
test(2297.03, y[x, on=.(c == a, d == a), verbose=TRUE], data.table(c=1L, d=1L), output="Coercing .*a .*no fractions.* to type integer.*Coercing .*c .*no fractions.* to type integer")
0 commit comments