Repository navigation
Return bare lists from S7 list conversion - #6916
Merged
teunbrand merged 4 commits intoOct 20, 2026
Merged
Conversation
teunbrand
approved these changes
Oct 20, 2026
teunbrand
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, thanks for this!
teunbrand
pushed a commit
that referenced
this pull request
Oct 21, 2026
* Return bare lists from S7 list conversion * Normalize constructor context in validation snapshot * Use built-in S7 list conversion * Retain explicit list conversion for compatibility
Contributor
Author
|
Thanks for merging these changes! I'm planning to submit the next version of S7 to CRAN on November 16 (see RConsortium/S7#786). Would you be able to submit an updated version of ggplot2 with these compatibility updates to CRAN before then? Please let me know if you need more time or if there’s anything I can help with. |
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.
Return bare lists from
as.list()andS7::convert(..., S7::class_list)for mappings, themes, and labels. Development S7 preserves their S3 parent classes inS7_data(), which prevents the list-to-mapping conversion method from dispatching and loses the mapping entries. Applyunclass()to remove those classes.S7's built-in conversion already handles these list-backed objects. Keep the explicit method for compatibility across S7 versions and to avoid potential recursion between
as.list()andconvert()if conversion reaches theas.list()fallback.For example, this roundtrip now preserves both aesthetics with development S7:
The element-text validation snapshot also accepts the constructor call included by S7 1.0 and omitted by earlier versions, while retaining the full validation diagnostic.