Skip to content

Steps sometimes destroy the epi_df #376

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

Closed
dajmcdon opened this issue Sep 11, 2024 · 2 comments · Fixed by #379
Closed

Steps sometimes destroy the epi_df #376

dajmcdon opened this issue Sep 11, 2024 · 2 comments · Fixed by #379
Labels
bug Something isn't working

Comments

@dajmcdon
Copy link
Contributor

  • step_epi_naomit() is one such. step_naomit() calls tibble::as_tibble() at the end.

Consider reconstructing the epi_df after each step inside the bake/prep loop.

@dajmcdon dajmcdon added the bug Something isn't working label Sep 11, 2024
@dsweber2
Copy link
Contributor

I was running into this in adjustAhead with step_mutate; I think most non-epipredict steps will do this.

My solution for this was to put the metadata in at prep time, but that isn't exactly ideal, as there may be different metadata at later points

@dajmcdon
Copy link
Contributor Author

dajmcdon commented Sep 12, 2024

This is potentially impossible to fix. Any call to bake() will destroy the epi_df at the end of the loop (unless we clobber recipes:::bake.recipe().

Reason:

bake(epi_recipe) -> recipes:::bake.recipe() -> ... -> hardhat::recompose(new_data,...) -> hardhat::coerce_to_tibble() -> hardhat::hardhat_new_tibble()

This last drops the class without recourse. I don't suspect they will be willing to change this behaviour: tidymodels/hardhat#230.

@dajmcdon dajmcdon mentioned this issue Sep 12, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants