Improve missing-value errors for numeric comparisons#148
Merged
Conversation
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.
Motivation
NA/NaN; this change makes those failures report a dedicated "no missing values" message.NaN/NAproduce the expected missing-value errors.Description
assert_no_missinginto numeric comparison assertion chains (e.g.assert_all_greater_than,assert_all_greater_than_or_equal_to,assert_all_less_than,assert_all_less_than_or_equal_to,assert_all_between,assert_between, and related wrappers) inR/assert_compare.Rso comparisons fail fast with a missing-values error.@include has.RtoR/assert_compare.Rand@include assert_create.RtoR/has.Rto ensure symbols are available during documentation loading.tests/testthat/test-assert_compare.Rchecking thatNaN(and vectors containingNaN) trigger the new missing-values error messages, and update the corresponding snapshottests/testthat/_snaps/assert_compare.md.NEWS.mdandDESCRIPTIONCollate ordering to reflect the changes.Testing
Rscript -e "devtools::document()"and documentation built successfully after adjusting includes.Rscript -e "devtools::test()"and all tests passed after accepting the updated snapshot viatestthat::snapshot_accept('assert_compare').Rscript -e "devtools::check()"which completed but reported 1 WARNING and 1 NOTE (missingqpdffor PDF checks and "unable to verify current time"); there were no errors butR CMD checkreturned with warnings/notes.Codex Task