-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(r): Use classed warnings to signal that a lossy conversion occur…
…red (#298) This lets a caller take appropriate action (or give an error, or give a better warning) if a lossy conversion occurs. Closes #297. ``` r library(nanoarrow) array <- as_nanoarrow_array(2^54, schema = na_int64()) convert_array(array, double()) #> Warning in convert_array.default(array, double()): 1 value(s) may have incurred #> loss of precision in conversion to double() #> [1] 1.80144e+16 withCallingHandlers( convert_array(array, double()), nanoarrow_warning_lossy_conversion = function(x) { warning( "This is a better explanation of what happened!", call. = conditionCall(x) ) tryInvokeRestart("muffleWarning") } ) #> Warning in (function (x) : This is a better explanation of what happened! #> [1] 1.80144e+16 ``` <sup>Created on 2023-09-18 with [reprex v2.0.2](https://reprex.tidyverse.org)</sup>
- Loading branch information
1 parent
804630d
commit cc10a28
Showing
9 changed files
with
33 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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