dplyr icon indicating copy to clipboard operation
dplyr copied to clipboard

Bring back legacy `arrange()` behavior with `dplyr.legacy_locale`

Open DavisVaughan opened this issue 3 years ago • 1 comments

Follow up to #6297 and #6263

So the general idea is:

  • In dplyr 1.1.0, the default behavior of both group_by() and arrange() sort in the C locale
  • You can revert to legacy behavior, where both sort with the system locale, with the option dplyr.legacy_locale = TRUE
  • You can override the arrange() locale with an explicit .locale argument, ~or with dplyr.locale = "fr", but we prefer the former~
  • You cannot override the C locale usage in group_by() (unless you revert to legacy behavior)

A few other notes about this PR:

  • Removed dplyr_locale(), which is no longer useful
  • Default .locale to NULL instead of dplyr_locale()
  • If multiple locale options are set, hierarchy of precedence is .locale, ~dplyr.locale~, dplyr.legacy_locale

One question: Do we even need dplyr.locale anymore? Is being able to revert to the legacy behavior good enough? If we think dplyr.locale would stick around permanently, then it makes sense to keep it too, since I would like dplyr.legacy_locale to phase out. dplyr.locale might be useful as a permanent escape hatch for the case where you are calling something that calls arrange() for you and doesn't expose .locale. (Update: We removed dplyr.locale)

DavisVaughan avatar Jul 11 '22 22:07 DavisVaughan

Okay I have removed support for dplyr.locale and refreshed the docs and tests to reflect that.

Also updated my original comment in this PR to reflect the new state of how arrange() and group_by() work in 1.1.0

I'm going to request one last review to ensure that this all looks good

DavisVaughan avatar Aug 10 '22 16:08 DavisVaughan