Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop caller_env from DataMask #6444

Merged
merged 5 commits into from
Sep 13, 2022
Merged

Drop caller_env from DataMask #6444

merged 5 commits into from
Sep 13, 2022

Conversation

hadley
Copy link
Member

@hadley hadley commented Sep 1, 2022

@romainfrancois @lionel- Does this look ok? As far as I can tell the only place this was used was when evaluating the glue spec for across(), and I'm pretty sure using the environment of the across() quosure is just as good (if not better).

(This is in preparation for #6442)

I still need to remove the other various argument that this makes redundant, but I wanted to double check that I wasn't missing anything obvious before I started on that.

Copy link
Member

@lionel- lionel- left a comment

Choose a reason for hiding this comment

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

I agree that the quosure env of top_across() better reproduces the caller-env of across().

I think the caller-env was somehow used in #5815 (see comment in #5824). I haven't analysed the PR again, but if the tests introduced there still work, then I see no issue with removing it.

@romainfrancois
Copy link
Member

I only skimmed through, but that looks alright, esp. if the tests agree.

@hadley
Copy link
Member Author

hadley commented Sep 1, 2022

I'll finish this off after #6438 to avoid merge conflicts.

Copy link
Member

@DavisVaughan DavisVaughan left a comment

Choose a reason for hiding this comment

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

I am somewhat certain you are planning on doing this based on your opening comment, but I went ahead and marked places where it looks like caller_env can be removed as an argument

R/mutate.R Show resolved Hide resolved
@@ -277,7 +277,7 @@ slice_rows <- function(.data, ..., caller_env, error_call = caller_env()) {
if (is_empty(dots)) {
Copy link
Member

Choose a reason for hiding this comment

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

Can caller_env be removed from slice_rows()?

R/filter.R Show resolved Hide resolved
R/summarise.R Outdated
@@ -205,7 +205,7 @@ summarise.rowwise_df <- function(.data, ..., .groups = NULL) {
summarise_cols <- function(.data, dots, caller_env, error_call = caller_env()) {
Copy link
Member

Choose a reason for hiding this comment

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

Can caller_env be removed from summarise_cols()?

@hadley hadley marked this pull request as ready for review September 13, 2022 16:19
@hadley
Copy link
Member Author

hadley commented Sep 13, 2022

Removing caller_env from group_by_prepare() will only break the cubble package; I think that's a reasonable tradeoff.

@hadley hadley requested a review from DavisVaughan September 13, 2022 16:19
@DavisVaughan
Copy link
Member

My revdep tracker issue also tells me that cubble is already broken from the between() updates

Copy link
Member

@DavisVaughan DavisVaughan left a comment

Choose a reason for hiding this comment

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

Possibly a NEWS bullet about group_by_prepare() since that was an exported function and we removed an arg

Comment on lines -211 to +209
new_groups <- c(new_groups, compat_lazy_dots(.dots, env = caller_env))
new_groups <- c(new_groups, compat_lazy_dots(.dots, env = caller_env(2)))
Copy link
Member

Choose a reason for hiding this comment

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

So I guess it still technically had meaning here, but we are ok with removing caller_env as an input arg because this is deprecated behavior?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah.

Copy link
Member Author

Choose a reason for hiding this comment

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

And the argument was particularly troublesome because (a) it lacked a leading . and (b) it had the same name as a function we called.

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.

4 participants