-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Revdep: checking for classes #6498
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
Comments
Informed by email, as there is no linked GitHub page in the DESCRIPTION files:
|
Mistakingly classified a related problem for this exact problem:
|
Not informed:
|
Hi @teunbrand |
Thanks for the hard work to improve ggplot2! I'm working on the fix to We have a method for addition that is now broken. Generally it looks like |
I'm also struggling with that myself, I've made a separate issue to discuss: #6504 |
Uh oh!
There was an error while loading. Please reload this page.
Problem
This issue emerged from a recent revdepcheck (de2715d), and affects an estimated 91 reverse dependencies.
The issue is that tests based on ggplot2's classes fail because we transitioned to S7 classes.
It includes tests for the class itself
But also tests that relate to class structure like so:
The following case works for now, but we might remove the manual
"ggplot"
S3 class in the future. It is not the recommended way of testing.This pattern may hold for other classes, like
mapping
,labels
,margin
or elements too.Solution
There are several possibilities for adjusting the test.
expect_true(is_ggplot(p))
. Theis_ggplot()
function is internally consistent regardless of whether the ggplot object is the old or new class.expect_true(inherits(p, c("ggplot", "ggplot2::ggplot")))
, which requires a match to one of the two classes.expect_s7_class(p, class_ggplot)
, but that will only be stable after we've released the new version. It is not suitable for backward compatibility.Unfortunately, this is not something that is straightforward to fix in ggplot2, so this probably will have to be updated in the reverse dependencies.
The text was updated successfully, but these errors were encountered: