Skip to content

anyNA(x) is not supported, but any(is.na(x)) is #904

Description

@damonbayer

I think anyNA(x) should be translated exactly as any(is.na(x)), but this is not implemented.

library(duckplyr)
#> Loading required package: dplyr
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
#> The duckplyr package is configured to fall back to dplyr when it encounters an
#> incompatibility. Fallback events can be collected and uploaded for analysis to
#> guide future development. By default, data will be collected but no data will
#> be uploaded.
#> ℹ Automatic fallback uploading is not controlled and therefore disabled, see
#>   `?duckplyr::fallback()`.
#> ✔ Number of reports ready for upload: 11.
#> → Review with `duckplyr::fallback_review()`, upload with
#>   `duckplyr::fallback_upload()`.
#> ℹ Configure automatic uploading with `duckplyr::fallback_config()`.
#> ✔ Overwriting dplyr methods with duckplyr methods.
#> ℹ Turn off with `duckplyr::methods_restore()`.
test_dat <- duckdb_tibble(a = c(1, 2, NA), .prudence = "stingy")

summarize(test_dat, anyNA(a), .by = a)
#> Error in `summarize()`:
#> ! This operation cannot be carried out by DuckDB, and the input is a
#>   stingy duckplyr frame.
#> ℹ Use `compute(prudence = "lavish")` to materialize to temporary storage and
#>   continue with duckplyr.
#> ℹ See `vignette("prudence")` for other options.
#> Caused by error in `summarize()`:
#> ! Can't translate function `anyNA()`.
summarize(test_dat, any(is.na(a)), .by = a)
#> # A duckplyr data frame: 2 variables
#>       a `any(is.na(a))`
#>   <dbl> <lgl>          
#> 1     2 FALSE          
#> 2    NA TRUE           
#> 3     1 FALSE

Created on 2026-03-23 with reprex v2.1.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions