Skip to content

GH-14734: [R] Deprecated filter + across usage - #51235

Merged
thisisnic merged 1 commit into
apache:mainfrom
thisisnic:GH-14734-filter-across
Sep 17, 2026
Merged

thisisnic merged 1 commit into
apache:mainfrom
thisisnic:GH-14734-filter-across

Conversation

@thisisnic

@thisisnic thisisnic commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

Rationale for this change

Wanna match deprecation of functions that dplyr has

What changes are included in this PR?

Warn when using across i filter

Are these changes tested?

Yeah

Are there any user-facing changes?

Yeah

Copilot AI lite review requested due to automatic review settings September 8, 2026 11:07
@thisisnic
thisisnic requested a review from jonkeane as a code owner September 8, 2026 11:07
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

⚠️ GitHub issue #14734 has been automatically assigned in GitHub to PR creator.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The warning behavior is implemented consistently with existing Arrow R deprecation patterns and is covered by targeted testthat expectations.

Pull request overview

This PR aligns Arrow R’s dplyr backend with dplyr’s deprecation of using across() inside filter() by emitting a lifecycle-style deprecation warning (also applied to Arrow’s filter_out() helper).

Changes:

  • Detect across() calls passed to filter() / filter_out() and emit a lifecycle_warning_deprecated warning (rate-limited via rlang::warn(.frequency = "regularly")).
  • Add test coverage asserting the warning message and class for both filter() and filter_out().
File summaries
File Description
r/R/dplyr-filter.R Adds deprecation warning when across() is used as a filter()/filter_out() predicate, then proceeds with existing expand_across() behavior.
r/tests/testthat/test-dplyr-filter.R Adds tests verifying the warning message and warning class for filter(across(...)) and filter_out(across(...)).
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jonkeane jonkeane left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you


expect_warning(
tab |> filter(across(c(int, dbl), ~ .x > 2)) |> collect(),
"Using `across\\(\\)` in `filter\\(\\)` is deprecated",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\\\\\\ 😂

@github-actions github-actions Bot added awaiting merge Awaiting merge and removed awaiting committer review Awaiting committer review labels Sep 16, 2026
@thisisnic
thisisnic merged commit 614a91b into apache:main Sep 17, 2026
36 checks passed
@thisisnic thisisnic removed the awaiting merge Awaiting merge label Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants