apache / apache/arrow-nanoarrow

Schema and ptype inference

Open
#347 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
249
Forks
68
Avg merge
2d 21h
Merged PRs (30d)
11

Description

- Should we allow `infer_nanoarrow_schema()` on schema objects?
- Should we allow `infer_nanoarrow_ptype()` on R objects, effectively emulating data roundtrip?

For DBI.

``` r
library(nanoarrow)

df <- data.frame(a = 1:3, b = 4.5, c = "five")
schema <- nanoarrow::infer_nanoarrow_schema(df)
nanoarrow::infer_nanoarrow_schema(schema)
#> Error in infer_nanoarrow_schema.default(schema): Can't infer Arrow type for object of class nanoarrow_schema
nanoarrow::infer_nanoarrow_ptype(df)
#> Error in nanoarrow::infer_nanoarrow_ptype(df): `x` must be a nanoarrow_schema(), nanoarrow_array(), or nanoarrow_array_stream()
tibble::as_tibble(nanoarrow::infer_nanoarrow_ptype(schema))
#> # A tibble: 0 × 3
#> # ℹ 3 variables: a , b , c
```

Created on 2023-12-25 with [reprex v2.0.2](https://reprex.tidyverse.org)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the infer_nanoarrow_schema() and infer_nanoarrow_ptype() entry points and reproduce the R examples in the issue. Determine the intended behavior for schema inputs and R objects in the DBI use case, then add coverage showing the accepted inputs and resulting types.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.