Improve facet error messages in animint2dir - #285
Conversation
Before :-
After :- |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #285 +/- ##
==========================================
+ Coverage 73.03% 73.08% +0.05%
==========================================
Files 164 164
Lines 8840 8858 +18
==========================================
+ Hits 6456 6474 +18
Misses 2384 2384
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
No obvious timing issues in HEAD=fix-168-facet-error-message Generated via commit c1877ef Download link for the artifact containing the test results: ↓ atime-results.zip
|
|
Sir @tdhock The 2 failing tests in JS_coverage are in test-compiler-ghpages.R (GitHub Pages tests), not related to this PR. This is the same race condition issue where parallel CI jobs conflict over the shared test repository. All facet-related tests pass:
The fix is working correctly. Please review and give your feedback Sir . |
|
Also Sir @tdhock atime performance tests / comment job failing actually has nothing to do with this PR :
Where it crashes: It crashes during R CMD INSTALL of that old commit with this error: Why does this happen:
My changes are never even reached — the job dies at install time before running any performance tests. There is also this warning in the log: This is an infrastructure/CI issue, not a code issue. Can you please tell what should I do not it is happening in my other PR's also . |
| test_that("facet_wrap formula with missing variable gives clear error", { | ||
| viz <- list( | ||
| scatter = ggplot() + | ||
| facet_wrap(. ~ NonExistentColumn) + |
There was a problem hiding this comment.
test missing with string notation too?
| facet_wrap(. ~ NonExistentColumn) + | |
| facet_wrap("MissingVar") + |
| ) | ||
| expect_error( | ||
| animint2dir(viz, out.dir = tempfile(), open.browser = FALSE), | ||
| "Facet variable not found in data: NonExistentColumn\nAvailable columns: Sepal.Length, Sepal.Width, Petal.Length, Petal.Width, Species\nUse string notation like facet_wrap(\"var\") instead of formula notation facet_wrap(. ~ var)", |
There was a problem hiding this comment.
this error describes two different problems
- facet variable not found
- formula notation bad
can you please separate these error messages?
| test_that("facet_wrap string notation works", { | ||
| viz <- list( | ||
| scatter = ggplot() + | ||
| facet_wrap("Species") + |
There was a problem hiding this comment.
does this work or error?
| facet_wrap("Species") + | |
| facet_wrap(~Species) + |
Detect facet_wrap(. ~ var) when vars exist and suggest ~var or "var" notation. Keep missing-variable errors separate without formula advice. Expand tests per tdhock review on PR #285.
Detect facet_wrap(. ~ var) when vars exist and suggest ~var or "var" notation. Keep missing-variable errors separate without formula advice. Expand tests per tdhock review on PR #285.
0fcc9cb to
6c7f082
Compare
Use expect_error blocks with animint2dir(viz) and drop explicit out.dir in success tests per tdhock review on PR #285.

FIXES #168
What's broken
Error: At least one layer must contain all variables used for facettingDoesn't tell you what's wrong or how to fix it.
facet_wrap("Species") # string notation works fineWhat I am fixing
Next commit will add the fix to make tests pass.