You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/01/25 22:05:26 UTC

[GitHub] [arrow] nealrichardson opened a new pull request #9321: ARROW-7288: alternate R-only workaround for std::regex issue

nealrichardson opened a new pull request #9321:
URL: https://github.com/apache/arrow/pull/9321


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] nealrichardson commented on pull request #9321: ARROW-7288: alternate R-only workaround for std::regex issue

Posted by GitBox <gi...@apache.org>.
nealrichardson commented on pull request #9321:
URL: https://github.com/apache/arrow/pull/9321#issuecomment-767854011


   Thanks both. Agree that withr is handy but didn't think it worth adding a dependency (even a light one) for something so trivial. In any case, it looks like we'll solve this more properly (either #9320 or #9332), and as Jeroen points out, it's probably not a safe thing to have a test for anyway, so I'll close this.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] yutannihilation commented on a change in pull request #9321: ARROW-7288: alternate R-only workaround for std::regex issue

Posted by GitBox <gi...@apache.org>.
yutannihilation commented on a change in pull request #9321:
URL: https://github.com/apache/arrow/pull/9321#discussion_r564389389



##########
File path: r/R/parquet.R
##########
@@ -567,3 +568,14 @@ ParquetArrowReaderProperties <- R6Class("ParquetArrowReaderProperties",
 ParquetArrowReaderProperties$create <- function(use_threads = option_use_threads()) {
   parquet___arrow___ArrowReaderProperties__Make(isTRUE(use_threads))
 }
+
+with_safe_locale <- function(expr) {
+  # ARROW-7288: due to a bug in libstdc++ on mingw, std::regex can blow up
+  # on other locales, and the parquet reader calls it
+  if (tolower(Sys.info()[["sysname"]]) == "windows") {
+    old_locale <- Sys.getlocale("LC_COLLATE")
+    Sys.setlocale("LC_COLLATE", "C")
+    on.exit(Sys.setlocale(old_locale))

Review comment:
       ```suggestion
       on.exit(Sys.setlocale("LC_COLLATE", old_locale))
   ```
   
   `category` is needed here, as the error message on CI suggests.
   
   ```
   Error: Error: invalid 'category' argument
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] github-actions[bot] commented on pull request #9321: ARROW-7288: alternate R-only workaround for std::regex issue

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #9321:
URL: https://github.com/apache/arrow/pull/9321#issuecomment-767157694


   https://issues.apache.org/jira/browse/ARROW-7288


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] github-actions[bot] commented on pull request #9321: ARROW-7288: alternate R-only workaround for std::regex issue

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #9321:
URL: https://github.com/apache/arrow/pull/9321#issuecomment-767157694


   https://issues.apache.org/jira/browse/ARROW-7288


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] nealrichardson closed pull request #9321: ARROW-7288: alternate R-only workaround for std::regex issue

Posted by GitBox <gi...@apache.org>.
nealrichardson closed pull request #9321:
URL: https://github.com/apache/arrow/pull/9321


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] jeroen commented on pull request #9321: ARROW-7288: alternate R-only workaround for std::regex issue

Posted by GitBox <gi...@apache.org>.
jeroen commented on pull request #9321:
URL: https://github.com/apache/arrow/pull/9321#issuecomment-767183967


   Few comments: 
   
    - You can use `withr::with_locale()` to simplify temporary setting the locale
    - Most servers won't have the Japanese language pack installed, so `Sys.setlocale("LC_COLLATE", "Japanese")` may fail
    - The bug is that the action takes very long, but it doesn't crash. So I'm not sure you'll detect the problem properly, or just that your tests will be taking super long to complete.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] jeroen edited a comment on pull request #9321: ARROW-7288: alternate R-only workaround for std::regex issue

Posted by GitBox <gi...@apache.org>.
jeroen edited a comment on pull request #9321:
URL: https://github.com/apache/arrow/pull/9321#issuecomment-767183967


   Few comments: 
   
    - You can use `withr::with_locale()` to simplify temporary setting the locale
    - Most servers won't have the Japanese language pack installed, so `Sys.setlocale("LC_COLLATE", "Japanese")` may fail
    - The bug is that the procedure takes very long to complete, but it succeed, eventually. Hence I'm not sure this test will detect the problem properly, or just that your tests will be taking super long to complete.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] jeroen commented on pull request #9321: ARROW-7288: alternate R-only workaround for std::regex issue

Posted by GitBox <gi...@apache.org>.
jeroen commented on pull request #9321:
URL: https://github.com/apache/arrow/pull/9321#issuecomment-767183967


   Few comments: 
   
    - You can use `withr::with_locale()` to simplify temporary setting the locale
    - Most servers won't have the Japanese language pack installed, so `Sys.setlocale("LC_COLLATE", "Japanese")` may fail
    - The bug is that the action takes very long, but it doesn't crash. So I'm not sure you'll detect the problem properly, or just that your tests will be taking super long to complete.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] jeroen edited a comment on pull request #9321: ARROW-7288: alternate R-only workaround for std::regex issue

Posted by GitBox <gi...@apache.org>.
jeroen edited a comment on pull request #9321:
URL: https://github.com/apache/arrow/pull/9321#issuecomment-767183967






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] jeroen edited a comment on pull request #9321: ARROW-7288: alternate R-only workaround for std::regex issue

Posted by GitBox <gi...@apache.org>.
jeroen edited a comment on pull request #9321:
URL: https://github.com/apache/arrow/pull/9321#issuecomment-767183967


   Few comments: 
   
    - You can use `withr::with_locale()` to simplify temporary setting the locale
    - Most servers won't have the Japanese language pack installed, so `Sys.setlocale("LC_COLLATE", "Japanese")` may fail
    - The bug is that the procedure takes very long to complete, but it succeed, eventually. Hence I'm not sure you'll detect the problem properly, or just that your tests will be taking super long to complete.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org