epi_df behavior for drop_na and pivot_*#692
Merged
brookslogan merged 13 commits intodevfrom Apr 20, 2026
Merged
Conversation
…luded in `epi_df` `other_keys` metadata
Contributor
Author
|
/style |
Contributor
Author
|
/document |
Contributor
Author
|
/preview-docs |
|
🚀 Deployed on https://69a28d80cd53146f84673751--epiprocess.netlify.app |
epi_df behavior for drop_na and pivot_* verbsepi_df behavior for drop_na and pivot_*
brookslogan
requested changes
Mar 18, 2026
Co-authored-by: brookslogan <brooks.logan+github@gmail.com>
…reates a new column with the same name as one column belonging to other_keys
JavierMtzRdz
commented
Apr 3, 2026
Contributor
Author
JavierMtzRdz
left a comment
There was a problem hiding this comment.
I have included the suggestions from your review! No relevant comments about it this time.
brookslogan
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
Please:
PR).
brookslogan, nmdefries.
DESCRIPTION. Always incrementthe patch version number (the third number), unless you are making a
release PR from dev to main, in which case increment the minor version
number (the second number).
(backwards-incompatible changes to the documented interface) are noted.
Collect the changes under the next release number (e.g. if you are on
1.7.2, then write your changes under the 1.8 heading).
/styleto check the style and fix any issues./documentto check the package documentation and fix any issues./preview-docsto preview the docs.process.
epi_dfbehavior fordrop_naandpivot_*verbsThis PR includes methods for
drop_naandpivot_*verbs.drop_naAlways returns an epi_df, as it only subsets rows and does not remove essential key columns.
pivot_widerpivot_widermethod preserves theepi_dfclass as long as thegeo_valueandtime_valuecolumns are present in the output. It also automatically updates theother_keysmetadata by removing any keys that were pivoted away or dropped during the transformation. However, the object will silently decay into atibbleifgeo_valueortime_valueare used innames_from, as this removes them from the column set.pivot_longerThe
pivot_longermethod automatically promotes the newnames_tocolumn to a key in theother_keysmetadata. If the resulting data is not unique on its keys even after this promotion, the method will issue a warning and the object will decay into atibble. Similar topivot_wider, the result will silently become atibbleif the essentialgeo_valueortime_valuecolumns are pivoted away.Magic GitHub syntax to mark associated Issue(s) as resolved when this is merged into the default branch