@@ -5886,9 +5886,10 @@ test(1374.2, DT[, list(x=sum(x)), by=y], data.table(y=c(1,2,3), x=c(5L, 7L, 3L))
58865886# Similarly, subset in i with := in j, updates that subset
58875887DT = as.data.table(iris)
58885888DT[,Species:=as.character(Species)]
5889- test(1375.1, DT[,mean(Petal.Width),by=Species][order(-V1),Species:=toupper(Species)]$Species, c("SETOSA","VERSICOLOR","VIRGINICA"))
5890- test(1375.2, DT[,mean(Petal.Width),by=Species][order(-V1)][,Species:=toupper(Species)]$Species, c("VIRGINICA","VERSICOLOR","SETOSA"))
5891- test(1375.3, DT[,mean(Petal.Width),by=Species][V1>1,Species:=toupper(Species)]$Species, c("setosa","VERSICOLOR","VIRGINICA"))
5889+ # toupper() here in both x and y because in some locales, toupper() can add accents (e.g. az_AZ)
5890+ test(1375.1, DT[,mean(Petal.Width),by=Species][order(-V1),Species:=toupper(Species)]$Species, toupper(c("setosa", "versicolor", "virginica")))
5891+ test(1375.2, DT[,mean(Petal.Width),by=Species][order(-V1)][,Species:=toupper(Species)]$Species, toupper(c("virginica", "versicolor", "setosa")))
5892+ test(1375.3, DT[,mean(Petal.Width),by=Species][V1>1,Species:=toupper(Species)]$Species, c("setosa", toupper(c("versicolor", "virginica"))))
58925893
58935894# Secondary keys a.k.a indexes ...
58945895DT = data.table(a=1:10,b=10:1)
0 commit comments