-
Notifications
You must be signed in to change notification settings - Fork 37
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
type_sum methods ignored for atomic vector based objects in a list column #321
Comments
Thanks. It works if we override What is your use case? Do you think we need to fix this here? library(pillar)
library(vctrs)
vec_ptype_abbr.list_class <- function(x) {
"list obj"
}
vec_ptype_abbr.atomic_class <- function(x) {
"atomic obj"
}
a <- structure(list(1:10), class = "list_class")
b <- structure(1:10, class = "atomic_class")
x <- structure(
list(a, b),
class = c("container", "list")
)
tibble::tibble(x = x)
#> # A tibble: 2 x 1
#> x
#> <containr>
#> 1 <list obj>
#> 2 <atomic obj [10]> Created on 2021-05-21 by the reprex package (v2.0.0) |
I am using it in parsermd when displaying the ast in a tibble format (as a column). The overall ast has a custom s3 class + list and then each node has their own S3 classes, all of these have their own specialization of This doesn't break anything critical for me, but it introduces an undesirable display glitch (and was causing snapshot tests to fail). |
Introduced in cd3b4e7, pillar 1.6.1 . |
Making it work with |
- `obj_sum()` no longer calls `type_sum()` for vectors since pillar v1.6.1, this is now documented (#321).
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary. |
In a recent change to pillar atomic vector based objects are no longer using
type_sum
methods when printing in a column, see the reprex below for an example:Previously the behavior was that the 2nd row would have contained
<atomic obj>
.The text was updated successfully, but these errors were encountered: