Skip to content

Conversation

Copy link

Copilot AI commented Nov 17, 2025

Use explicit namespace qualification (dplyr::n() and base::sum()) instead of bare function names in quosure expressions to satisfy duckplyr's function identity checks.

Changes

  • Changed expr(n()) to expr(dplyr::n()) in the null weight case
  • Changed expr(sum(!!wt, na.rm = TRUE)) to expr(base::sum(!!wt, na.rm = TRUE)) in the weighted case
  • Reverted environment from baseenv() back to quo_get_env(wt) for weighted case since explicit qualification makes environment less critical

This approach is cleaner than using quosures with specific environments because the namespace qualification is directly in the expression.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Create quosures in tally_n function Use explicit namespace qualification in tally_n() Nov 17, 2025
Copilot finished work on behalf of krlmlr November 17, 2025 23:00
Copilot AI requested a review from krlmlr November 17, 2025 23:00
@krlmlr krlmlr closed this Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants