Improve facet error messages in animint2dir#285
Conversation
Issue #168 - facet_wrap(. ~ var) gives unhelpful error when var is missing. Added tests that will pass once we improve error messages in animint2dir(). Tests cover facet_wrap and facet_grid with missing variables. These tests are animint2-specific .
When facet_wrap or facet_grid uses formula notation with a variable that does not exist in the data, the error now shows: - Which variable is missing - What columns are available - Suggests using string notation instead Fixes #168
Before :-
After :- |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #285 +/- ##
==========================================
+ Coverage 73.09% 73.12% +0.02%
==========================================
Files 164 164
Lines 8769 8778 +9
==========================================
+ Hits 6410 6419 +9
Misses 2359 2359
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Generated via commit bf4c37c 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 . |

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.