-
Notifications
You must be signed in to change notification settings - Fork 10
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
Find long-term solution to as_tibble.epi_df
#51
Comments
In addition, when we implement a solution here, the S3 implementation should be migrated from
|
This was my doing. The issue is that Long term, I'm ok with having the function here (with comments that explain the issue) as long as it "works" and it's not user-facing. It's not needed in |
Sounds like I need to drop in a test that throws an error without this (potentially troublesome) conversion. |
So I think what we're doing now in Like, I'm thinking that intuitively it's probably bad to have a function that's called On the other hand, we don't really have other option than to do this, if we plan to use If we're going to do the latter, should we try to anticipate some issues that might arise when someone expects to use a bare tibble, but instead receives a tibble WITH epi_df metadata, but without the epi_df class marker? Hopefully, my point here is clear, let me know if it doesn't make sense. |
It seems like there's possibly some misunderstanding here. Suppose Now, when we use The intention here is for |
I follow all that and understand that we need some way to intercept calls to My questions were more directed at what exactly should But that was just a temporary hotfix to get our tests to pass.
And case in point, I didn't have to go far to find another issue. In trying to answer questions for this reply, I found that this line in a basic epiprocess vignette gives the error
which is the exact same error we had when there was an infinite regress of calls that started this issue. I unfortunately don't have enough R standard practice knowledge to say what to do, but certainly this seems like a very tricky thing to get right. |
Ah, ok I see.
So to Summarize: long term we need
These two seem to be in conflict. |
To be precise about the exact loop we saw for the OP issue, it was in this function debugging in: dplyr_col_modify.grouped_df(as_tibble(data), cols)
debug: {
out <- dplyr_col_modify(as_tibble(data), cols)
if (any(names(cols) %in% group_vars(data))) {
grouped_df(out, group_vars(data), drop = group_by_drop_default(data))
}
else {
new_grouped_df(out, group_data(data))
}
} The loop is |
I see, so that's fair, it seems that the I basically have two propositions at this point for
If these cause fix some set of infinite regress issues, but cause other ones, then I'm not sure what we should do. |
My current plan is to try to intervene in the |
Agree with the plan above to try to eliminate this implementation. [Edit: didn't see this was already completed!] ( example
|
I've removed the offending function in #65 and implemented a fix. I'm going to go ahead and close this issue, but I can foresee it cropping up again. And the removal is a bit cludgy. I put in a few tests to try to catch it directly if someone messes with |
As Logan and I found in #49, care must be taken with how we write
as_tibble.epi_df
.The tradeoffs are as follows:
as_tibble.epi_df
doesn't remove metadata, then it doesn't actually convert the class to a tibble, which causes an infinite loop insidedplyr::dplyr_col_modify
as_tibble
not actually return a tibbleas_tibble.epi_df
does remove metadata, then we have the issue of losingepi_df
information every time we use, for instance,epi_df %>% group_by() %>% mutate()
Possible solutions are:
dplyr
usesas_tibble
, e.g.mutate
and add S3 alternatives for thoseThe text was updated successfully, but these errors were encountered: