Support more locales in R-CMD-check-occasional - #7869
Conversation
Generated via commit ef77a1e Download link for the artifact containing the test results: ↓ atime-results.zip
|
a8575a9 to
9e6ca2e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7869 +/- ##
=======================================
Coverage 99.01% 99.01%
=======================================
Files 88 88
Lines 17293 17293
=======================================
Hits 17123 17123
Misses 170 170 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
At least partly this is blocked by an upstream error that {R.oo} can't install in |
9e6ca2e to
d47cd3c
Compare
852132f to
07ca251
Compare
|
Interesting. I've tried |
ecab787 to
625d570
Compare
625d570 to
df1d097
Compare
3a54e8a to
52b650c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
Surprising that the same date works in all the problem locales! passes = function() format(as.Date(strptime(strftime(as.Date('2000-11-01'), '%Y %d %b'), '%Y %d %b'))) == '2000-11-01'
for (ll in c("bo_CN", "bo_IN", "dz_BT", "km_KH", "shn_MM", "tok", "vi_VN"))
print(withr::with_locale(list(LC_TIME=ll), passes()))
# all FALSE
# .utf8 suffix needed for https://bugs.r-project.org/show_bug.cgi?id=19117#c1
for (ll in c("en_US", "zh_CN.utf8", "lv_LV", "es_ES", "ru_RU.utf8", "pl_PL", "th_TH.utf8"))
print(withr::with_locale(list(LC_TIME=ll), passes()))
# all TRUE |
|
Looking at the actual 168 series, it looks like the NOV = format(strptime("2000-11-01", "%Y-%m-%d"), "%b")
x = c("09:29:16","10:42:40","23:47:12","01:06:01","11:35:34","11:51:09")
datetimes = paste0("2011 ", NOV, c(18,18,18,19,19,19), " ", x)
DT = IDateTime(strptime(datetimes,"%Y %b%d %H:%M:%S"))AFAICT {data.table} only gets involved with the POSIXlt object received from #4719 added that, it just took the step of making |
ab2482f to
4fff6f0
Compare
7490eab to
ef748a3
Compare
|
Grr, why is Edit: it's the pathological case. The string vector being sorted is Edit: x <- c("tgaaznck", "zcbkervn", "mttamosk", "rnargwdj", "ylzuozyx", "ncnzxvrz")
idx_c <- order(x, method='radix')
idx_r <- order(x, method='shell')
table(radix = x[idx_c], shell = x[idx_r])We can remove one element to make the sort order identical. Unfortunately, the one mis-sorted element is second-to-last, so removing For |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
OK, Once that's fixed, it becomes exceedingly unlikely to wind up with few enough strings that they are sorted after |

As surfaced during review,
lv_LVis not quite enough to catch all possible collation issues.Since this CI is only run "rarely", combinatorial explosion of settings is not so big a concern.
Besides simply adding the locales, there are a few fixes to the suite to get it green. Mostly, it's because on R 3.5, we install from an ancient snapshot of CRAN:
as.nanotime(); AFAICT,nanotime()is identicalNAfor out-of-bouds indexingenv=; it turns out we can justSys.setenv()for all cases anyway.