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

Provide some way to suppress warning about unknown extension? #631

Open
hadley opened this issue Sep 20, 2024 · 3 comments · May be fixed by #632
Open

Provide some way to suppress warning about unknown extension? #631

hadley opened this issue Sep 20, 2024 · 3 comments · May be fixed by #632

Comments

@hadley
Copy link

hadley commented Sep 20, 2024

e.g.

geography: Converting unknown extension google:sqlType:geography{string} as storage type
Backtrace:
    ▆
 1. ├─bigrquery::bq_table_download(tb, api = "arrow", quiet = TRUE) at test-bq-download.R:103:3
 2. │ └─bigrquerystorage::bqs_table_download(...) at bigrquery/R/bq-download.R:122:7
 3. │   ├─base::as.data.frame(nanoarrow::read_nanoarrow(raws)) at bigrquerystorage/R/bqs_download.R:111:3
 4. │   └─nanoarrow:::as.data.frame.nanoarrow_array_stream(nanoarrow::read_nanoarrow(raws))
 5. │     └─nanoarrow::infer_nanoarrow_ptype(x$get_schema())
 6. └─nanoarrow:::infer_ptype_other(`<nnrrw_sc>`)
 7.   ├─nanoarrow::infer_nanoarrow_ptype_extension(spec, schema)
 8.   └─nanoarrow:::infer_nanoarrow_ptype_extension.default(spec, schema)
 9.     └─nanoarrow:::warn_unregistered_extension_type(x)
@paleolimbot
Copy link
Member

Great point!

Maybe not worth doing immediately since extension types are not that well tested in the wild; however, the built-in extension system should be able to handle converting geography columns to wk::wkt(geodesic = TRUE, crs=wk::wk_crs_longlat()).

@meztez
Copy link

meztez commented Sep 21, 2024

Trying to figure out why the internal is not able to pick it up.
Here is a raws vector to test out.
raws.zip

a <- readRDS("raws.zip")
b <- as.data.frame(a)
Warning messages:
1: In warn_unregistered_extension_type(x) :
  datetime: Converting unknown extension google:sqlType:datetime{timestamp('us', '')} as storage type
2: In warn_unregistered_extension_type(x) :
  geography: Converting unknown extension google:sqlType:geography{string} as storage type
3: In warn_unregistered_extension_type(x) :
  b: Converting unknown extension google:sqlType:geography{string} as storage type
4: In warn_unregistered_extension_type(x) :
  geo: Converting unknown extension google:sqlType:geography{list<item: string>} as storage type
5: In warn_unregistered_extension_type(storage) :
  datetime: Converting unknown extension google:sqlType:datetime{timestamp('us', '')} as storage type
6: In warn_unregistered_extension_type(storage) :
  geography: Converting unknown extension google:sqlType:geography{string} as storage type
7: In warn_unregistered_extension_type(storage) :
  b: Converting unknown extension google:sqlType:geography{string} as storage type
8: In warn_unregistered_extension_type(storage) :
  geo: Converting unknown extension google:sqlType:geography{list<item: string>} as storage type

@paleolimbot
Copy link
Member

Thank you for the reproducer!

After #632 this should be:

# Using pak::pak("apache/arrow-nanoarrow/r#632")
ipc_raw <- readr::read_rds("https://github.com/user-attachments/files/17082385/raws.zip")

options(nanoarrow.warn_unregistered_extension = FALSE)
ipc_raw |> 
  nanoarrow::read_nanoarrow() |> 
  tibble::as_tibble()
#> # A tibble: 1 × 15
#>   unicode datetime            logicaltrue logicalfalse     bytes date      
#>   <chr>   <dttm>              <lgl>       <lgl>           <blob> <date>    
#> 1 😃      2000-01-02 03:04:05 TRUE        FALSE        <raw 2 B> 2000-01-02
#> # ℹ 9 more variables: time <time>, timestamp <dttm>, geography <chr>,
#> #   s <df[,2]>, a <list<dbl>>, aos <list<df[,2]>>, soa <df[,2]>, bb <df[,2]>,
#> #   gg <df[,1]>

Created on 2024-09-20 with reprex v2.1.1

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 a pull request may close this issue.

3 participants