Skip to content
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

fix(r/adbcdrivermanager): Ensure that class of object is checked before calling R_ExternalPtrAddrFn #1989

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

paleolimbot
Copy link
Member

In the development version of R, calling R_ExternalPtrAddrFn() on an SEXP that is not an external pointer will raise an error. Because we test the error message, the order of our check vs. the call to R_ExternalPtrAddrFn() matters. In general, it makes more sense to do our own check first anyway!

https://cran.r-project.org/web/checks/check_results_adbcdrivermanager.html

   > test_check("adbcdrivermanager")
    [ FAIL 1 | WARN 0 | SKIP 3 | PASS 176 ]
    
    ══ Skipped tests (3) ═══════════════════════════════════════════════════════════
    • On CRAN (3): 'test-driver_log.R:19:3', 'test-helpers.R:22:3',
      'test-helpers.R:112:3'
    
    ══ Failed tests ════════════════════════════════════════════════════════════════
    ── Error ('test-radbc.R:188:3'): invalid external pointer inputs generate errors ──
    Error in `adbc_database_init_default(driver, list(...))`: R_ExternalPtrAddrFn: argument of type STRSXP is not an external pointer

@github-actions github-actions bot added this to the ADBC Libraries 14 milestone Jul 8, 2024
@paleolimbot paleolimbot merged commit 7dcb2d1 into apache:main Jul 9, 2024
22 checks passed
@paleolimbot paleolimbot deleted the r-adbcdrivermanager-fix-error branch July 9, 2024 00:04
paleolimbot added a commit to paleolimbot/arrow-adbc that referenced this pull request Jul 9, 2024
…re calling R_ExternalPtrAddrFn (apache#1989)

In the development version of R, calling `R_ExternalPtrAddrFn()` on an
SEXP that is not an external pointer will raise an error. Because we
test the error message, the order of our check vs. the call to
`R_ExternalPtrAddrFn()` matters. In general, it makes more sense to do
our own check first anyway!


https://cran.r-project.org/web/checks/check_results_adbcdrivermanager.html

```
   > test_check("adbcdrivermanager")
    [ FAIL 1 | WARN 0 | SKIP 3 | PASS 176 ]
    
    ══ Skipped tests (3) ═══════════════════════════════════════════════════════════
    • On CRAN (3): 'test-driver_log.R:19:3', 'test-helpers.R:22:3',
      'test-helpers.R:112:3'
    
    ══ Failed tests ════════════════════════════════════════════════════════════════
    ── Error ('test-radbc.R:188:3'): invalid external pointer inputs generate errors ──
    Error in `adbc_database_init_default(driver, list(...))`: R_ExternalPtrAddrFn: argument of type STRSXP is not an external pointer
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants