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

feat: add missing functions and docs for LazyFrame #31

Open
wants to merge 85 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
8adac2c
init
etiennebacher Nov 4, 2024
9827498
fix compil
etiennebacher Nov 5, 2024
88e0db0
more
etiennebacher Nov 5, 2024
1f8fd9b
more
etiennebacher Nov 5, 2024
c89f35c
more
etiennebacher Nov 5, 2024
eb01839
more
etiennebacher Nov 5, 2024
c56a28c
joins
etiennebacher Nov 5, 2024
a0610d0
more
etiennebacher Nov 5, 2024
8b6e582
more
etiennebacher Nov 5, 2024
215f2a2
collect_schema(), redoc
etiennebacher Nov 5, 2024
514f16b
$profile()
etiennebacher Nov 6, 2024
8498526
serde
etiennebacher Nov 6, 2024
de3e5e0
sink_parquet
etiennebacher Nov 6, 2024
216d0c2
sink_ipc
etiennebacher Nov 6, 2024
17de1fc
sink_csv
etiennebacher Nov 6, 2024
8a53cb9
sink_ndjson
etiennebacher Nov 6, 2024
9fff00f
redoc
etiennebacher Nov 6, 2024
2f6334d
join_asof
etiennebacher Nov 6, 2024
f2ecda7
Merge branch 'main' into lazyframe
etiennebacher Nov 9, 2024
dfe23f7
Merge branch 'main' into lazyframe
etiennebacher Nov 15, 2024
b974252
Merge branch 'main' into lazyframe
etiennebacher Nov 15, 2024
bf0475f
Merge branch 'main' into lazyframe
etiennebacher Nov 21, 2024
b98861f
remove duplicated fun
etiennebacher Nov 21, 2024
0ac744c
lint
etiennebacher Nov 21, 2024
7a87e3d
revamp tests tools
etiennebacher Nov 21, 2024
0b3f944
minor
etiennebacher Nov 21, 2024
a530ef5
typo
etiennebacher Nov 21, 2024
b48f928
Merge branch 'main' into lazyframe
etiennebacher Nov 22, 2024
ae09900
add unnest for dataframe
etiennebacher Nov 22, 2024
9c8759e
Merge branch 'main' into lazyframe
etiennebacher Nov 23, 2024
76be20c
Merge branch 'lazyframe' of https://github.com/etiennebacher/neo-r-po…
etiennebacher Nov 23, 2024
6b4cc9c
rename files
etiennebacher Nov 23, 2024
a93abf5
minor
etiennebacher Nov 23, 2024
3fcdcff
back to previous way
etiennebacher Nov 23, 2024
81b954c
improve custom expectations
etiennebacher Nov 23, 2024
4009a6f
more
etiennebacher Nov 24, 2024
f4e657d
more tests
etiennebacher Nov 24, 2024
abd760a
Merge branch 'main' into lazyframe
etiennebacher Nov 27, 2024
4dc4d0c
minor
etiennebacher Nov 27, 2024
ec91129
more
etiennebacher Nov 28, 2024
8e0c16a
Merge branch 'main' into lazyframe
etiennebacher Nov 28, 2024
ffafb75
redoc
etiennebacher Nov 28, 2024
4d3f654
more tests for rolling
etiennebacher Nov 29, 2024
4e608da
more tests
etiennebacher Nov 29, 2024
ff1c6d8
join_asof tests
etiennebacher Nov 29, 2024
e54253e
test unique, fill_null
etiennebacher Nov 29, 2024
9603ad8
tests fill_nan, drop, drop_nulls, filter
etiennebacher Nov 29, 2024
10d3fbb
Merge branch 'main' into lazyframe
etiennebacher Nov 30, 2024
077ba1a
redoc
etiennebacher Nov 30, 2024
96fec30
more tests for join
etiennebacher Nov 30, 2024
2995da2
test for unnest
etiennebacher Nov 30, 2024
0245b95
docs: fix math notation in `emw_` functions
etiennebacher Nov 30, 2024
23bd756
Merge branch 'main' into lazyframe
etiennebacher Nov 30, 2024
4d64a28
Merge branch 'main' into lazyframe
etiennebacher Dec 1, 2024
72493c5
most comments
etiennebacher Dec 1, 2024
1c60c0b
Merge branch 'main' into lazyframe
etiennebacher Dec 2, 2024
1ba97b2
remove old parquet file
etiennebacher Dec 2, 2024
761f2f6
missing to_string()
etiennebacher Dec 2, 2024
24c4a21
add back TODO
etiennebacher Dec 2, 2024
89119f5
PlRLazyFrame -> Self
etiennebacher Dec 2, 2024
24ad776
remove `@rdname`
etiennebacher Dec 2, 2024
4ed27f0
remove unreachable!()
etiennebacher Dec 2, 2024
b621355
remove more format!()
etiennebacher Dec 2, 2024
385aabf
redoc
etiennebacher Dec 2, 2024
b39dae6
formatting csv
etiennebacher Dec 3, 2024
c8b08ea
rework unnest()
etiennebacher Dec 3, 2024
4adf200
snapshots
etiennebacher Dec 3, 2024
9058679
Merge branch 'main' into lazyframe
etiennebacher Dec 9, 2024
b0de8b7
remove fetch
etiennebacher Dec 9, 2024
80fd3a1
add new args in sink_ functions
etiennebacher Dec 9, 2024
f966da4
redoc
etiennebacher Dec 9, 2024
512910e
answer some whys
etiennebacher Dec 9, 2024
7dfc8fb
remove clone_in_rust
etiennebacher Dec 9, 2024
abf7e8c
use lazy API in eager unnest()
etiennebacher Dec 9, 2024
adbdcba
just remove eager unnest
etiennebacher Dec 9, 2024
71d5240
other non-lazy changes
etiennebacher Dec 9, 2024
08219cc
same
etiennebacher Dec 9, 2024
9c28657
more
etiennebacher Dec 9, 2024
33d5f90
more
etiennebacher Dec 9, 2024
a3e20ee
remove broken sql function
etiennebacher Dec 9, 2024
78ff2ff
remove last remnants of old r-polars
etiennebacher Dec 9, 2024
03d10d4
use missing(...) in sort()
etiennebacher Dec 11, 2024
0532cd5
add TODO in $rename()
etiennebacher Dec 11, 2024
25dcda8
rewrite $rename()
etiennebacher Dec 12, 2024
100be73
rename: check that input are strings
etiennebacher Dec 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
319 changes: 319 additions & 0 deletions R/000-wrappers.R
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ NULL
.savvy_wrap_PlRWhen(.Call(savvy_when__impl, `condition`))
}


`deserialize_lf` <- function(`json`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_deserialize_lf__impl, `json`))
}

### wrapper functions for PlRChainedThen

`PlRChainedThen_when` <- function(self) {
Expand Down Expand Up @@ -470,6 +475,12 @@ class(`PlRChainedWhen`) <- c("PlRChainedWhen__bundle", "savvy_neopolars__sealed"
}
}

`PlRDataFrame_unnest` <- function(self) {
function(`columns`) {
.savvy_wrap_PlRDataFrame(.Call(savvy_PlRDataFrame_unnest__impl, `self`, `columns`))
}
}

`.savvy_wrap_PlRDataFrame` <- function(ptr) {
e <- new.env(parent = emptyenv())
e$.ptr <- ptr
Expand All @@ -491,6 +502,7 @@ class(`PlRChainedWhen`) <- c("PlRChainedWhen__bundle", "savvy_neopolars__sealed"
e$`to_struct` <- `PlRDataFrame_to_struct`(ptr)
e$`n_chunks` <- `PlRDataFrame_n_chunks`(ptr)
e$`rechunk` <- `PlRDataFrame_rechunk`(ptr)
e$`unnest` <- `PlRDataFrame_unnest`(ptr)

class(e) <- c("PlRDataFrame", "savvy_neopolars__sealed")
e
Expand Down Expand Up @@ -3361,6 +3373,271 @@ class(`PlRExpr`) <- c("PlRExpr__bundle", "savvy_neopolars__sealed")
}
}

`PlRLazyFrame_to_dot` <- function(self) {
function(`optimized`) {
.savvy_wrap_String(.Call(savvy_PlRLazyFrame_to_dot__impl, `self`, `optimized`))
}
}

`PlRLazyFrame_sort` <- function(self) {
function(`by_column`, `descending`, `nulls_last`, `maintain_order`, `multithreaded`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_sort__impl, `self`, `by_column`, `descending`, `nulls_last`, `maintain_order`, `multithreaded`))
}
}

`PlRLazyFrame_top_k` <- function(self) {
function(`k`, `by`, `reverse`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_top_k__impl, `self`, `k`, `by`, `reverse`))
}
}

`PlRLazyFrame_bottom_k` <- function(self) {
function(`k`, `by`, `reverse`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_bottom_k__impl, `self`, `k`, `by`, `reverse`))
}
}

`PlRLazyFrame_cache` <- function(self) {
function() {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_cache__impl, `self`))
}
}

`PlRLazyFrame_profile` <- function(self) {
function() {
.Call(savvy_PlRLazyFrame_profile__impl, `self`)
}
}

`PlRLazyFrame_sink_parquet` <- function(self) {
function(`path`, `compression`, `maintain_order`, `statistics`, `compression_level` = NULL, `row_group_size` = NULL, `data_page_size` = NULL) {
invisible(.Call(savvy_PlRLazyFrame_sink_parquet__impl, `self`, `path`, `compression`, `maintain_order`, `statistics`, `compression_level`, `row_group_size`, `data_page_size`))
}
}

`PlRLazyFrame_sink_ipc` <- function(self) {
function(`path`, `maintain_order`, `compression` = NULL) {
invisible(.Call(savvy_PlRLazyFrame_sink_ipc__impl, `self`, `path`, `maintain_order`, `compression`))
}
}

`PlRLazyFrame_sink_csv` <- function(self) {
function(`path`, `include_bom`, `include_header`, `separator`, `line_terminator`, `quote_char`, `maintain_order`, `batch_size`, `datetime_format` = NULL, `date_format` = NULL, `time_format` = NULL, `float_scientific` = NULL, `float_precision` = NULL, `null_value` = NULL, `quote_style` = NULL) {
invisible(.Call(savvy_PlRLazyFrame_sink_csv__impl, `self`, `path`, `include_bom`, `include_header`, `separator`, `line_terminator`, `quote_char`, `maintain_order`, `batch_size`, `datetime_format`, `date_format`, `time_format`, `float_scientific`, `float_precision`, `null_value`, `quote_style`))
}
}

`PlRLazyFrame_sink_json` <- function(self) {
function(`path`, `maintain_order`) {
invisible(.Call(savvy_PlRLazyFrame_sink_json__impl, `self`, `path`, `maintain_order`))
}
}

`PlRLazyFrame_serialize` <- function(self) {
function() {
.Call(savvy_PlRLazyFrame_serialize__impl, `self`)
}
}

`PlRLazyFrame_select_seq` <- function(self) {
function(`exprs`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_select_seq__impl, `self`, `exprs`))
}
}

`PlRLazyFrame_rolling` <- function(self) {
function(`index_column`, `period`, `offset`, `closed`, `by`) {
`index_column` <- .savvy_extract_ptr(`index_column`, "PlRExpr")
.savvy_wrap_PlRLazyGroupBy(.Call(savvy_PlRLazyFrame_rolling__impl, `self`, `index_column`, `period`, `offset`, `closed`, `by`))
}
}

`PlRLazyFrame_group_by_dynamic` <- function(self) {
function(`index_column`, `every`, `period`, `offset`, `label`, `include_boundaries`, `closed`, `group_by`, `start_by`) {
`index_column` <- .savvy_extract_ptr(`index_column`, "PlRExpr")
.savvy_wrap_PlRLazyGroupBy(.Call(savvy_PlRLazyFrame_group_by_dynamic__impl, `self`, `index_column`, `every`, `period`, `offset`, `label`, `include_boundaries`, `closed`, `group_by`, `start_by`))
}
}

`PlRLazyFrame_with_context` <- function(self) {
function(`contexts`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_with_context__impl, `self`, `contexts`))
}
}

`PlRLazyFrame_join_asof` <- function(self) {
function(`other`, `left_on`, `right_on`, `allow_parallel`, `force_parallel`, `suffix`, `coalesce`, `strategy`, `left_by` = NULL, `right_by` = NULL, `tolerance` = NULL, `tolerance_str` = NULL) {
`other` <- .savvy_extract_ptr(`other`, "PlRLazyFrame")
`left_on` <- .savvy_extract_ptr(`left_on`, "PlRExpr")
`right_on` <- .savvy_extract_ptr(`right_on`, "PlRExpr")
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_join_asof__impl, `self`, `other`, `left_on`, `right_on`, `allow_parallel`, `force_parallel`, `suffix`, `coalesce`, `strategy`, `left_by`, `right_by`, `tolerance`, `tolerance_str`))
}
}

`PlRLazyFrame_join` <- function(self) {
function(`other`, `left_on`, `right_on`, `allow_parallel`, `force_parallel`, `join_nulls`, `how`, `suffix`, `validate`, `coalesce` = NULL) {
`other` <- .savvy_extract_ptr(`other`, "PlRLazyFrame")
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_join__impl, `self`, `other`, `left_on`, `right_on`, `allow_parallel`, `force_parallel`, `join_nulls`, `how`, `suffix`, `validate`, `coalesce`))
}
}

`PlRLazyFrame_join_where` <- function(self) {
function(`other`, `predicates`, `suffix`) {
`other` <- .savvy_extract_ptr(`other`, "PlRLazyFrame")
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_join_where__impl, `self`, `other`, `predicates`, `suffix`))
}
}

`PlRLazyFrame_with_columns_seq` <- function(self) {
function(`exprs`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_with_columns_seq__impl, `self`, `exprs`))
}
}

`PlRLazyFrame_rename` <- function(self) {
function(`existing`, `new`, `strict`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_rename__impl, `self`, `existing`, `new`, `strict`))
}
}

`PlRLazyFrame_reverse` <- function(self) {
function() {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_reverse__impl, `self`))
}
}

`PlRLazyFrame_shift` <- function(self) {
function(`n`, `fill_value` = NULL) {
`n` <- .savvy_extract_ptr(`n`, "PlRExpr")
`fill_value` <- .savvy_extract_ptr(`fill_value`, "PlRExpr")
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_shift__impl, `self`, `n`, `fill_value`))
}
}

`PlRLazyFrame_fill_nan` <- function(self) {
function(`fill_value`) {
`fill_value` <- .savvy_extract_ptr(`fill_value`, "PlRExpr")
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_fill_nan__impl, `self`, `fill_value`))
}
}

`PlRLazyFrame_fill_null` <- function(self) {
function(`fill_value`) {
`fill_value` <- .savvy_extract_ptr(`fill_value`, "PlRExpr")
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_fill_null__impl, `self`, `fill_value`))
}
}

`PlRLazyFrame_min` <- function(self) {
function() {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_min__impl, `self`))
}
}

`PlRLazyFrame_max` <- function(self) {
function() {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_max__impl, `self`))
}
}

`PlRLazyFrame_sum` <- function(self) {
function() {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_sum__impl, `self`))
}
}

`PlRLazyFrame_mean` <- function(self) {
function() {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_mean__impl, `self`))
}
}

`PlRLazyFrame_std` <- function(self) {
function(`ddof`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_std__impl, `self`, `ddof`))
}
}

`PlRLazyFrame_var` <- function(self) {
function(`ddof`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_var__impl, `self`, `ddof`))
}
}

`PlRLazyFrame_median` <- function(self) {
function() {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_median__impl, `self`))
}
}

`PlRLazyFrame_quantile` <- function(self) {
function(`quantile`, `interpolation`) {
`quantile` <- .savvy_extract_ptr(`quantile`, "PlRExpr")
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_quantile__impl, `self`, `quantile`, `interpolation`))
}
}

`PlRLazyFrame_explode` <- function(self) {
function(`column`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_explode__impl, `self`, `column`))
}
}

`PlRLazyFrame_null_count` <- function(self) {
function() {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_null_count__impl, `self`))
}
}

`PlRLazyFrame_unique` <- function(self) {
function(`maintain_order`, `keep`, `subset` = NULL) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_unique__impl, `self`, `maintain_order`, `keep`, `subset`))
}
}

`PlRLazyFrame_drop_nulls` <- function(self) {
function(`subset` = NULL) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_drop_nulls__impl, `self`, `subset`))
}
}

`PlRLazyFrame_unpivot` <- function(self) {
function(`on`, `index`, `value_name` = NULL, `variable_name` = NULL) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_unpivot__impl, `self`, `on`, `index`, `value_name`, `variable_name`))
}
}

`PlRLazyFrame_with_row_index` <- function(self) {
function(`name`, `offset` = NULL) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_with_row_index__impl, `self`, `name`, `offset`))
}
}

`PlRLazyFrame_clone` <- function(self) {
function() {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_clone__impl, `self`))
}
}

`PlRLazyFrame_unnest` <- function(self) {
function(`columns`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_unnest__impl, `self`, `columns`))
}
}

`PlRLazyFrame_count` <- function(self) {
function() {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_count__impl, `self`))
}
}

`PlRLazyFrame_merge_sorted` <- function(self) {
function(`other`, `key`) {
`other` <- .savvy_extract_ptr(`other`, "PlRLazyFrame")
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_merge_sorted__impl, `self`, `other`, `key`))
}
}

`.savvy_wrap_PlRLazyFrame` <- function(ptr) {
e <- new.env(parent = emptyenv())
e$.ptr <- ptr
Expand All @@ -3381,6 +3658,48 @@ class(`PlRExpr`) <- c("PlRExpr__bundle", "savvy_neopolars__sealed")
e$`collect_schema` <- `PlRLazyFrame_collect_schema`(ptr)
e$`sort_by_exprs` <- `PlRLazyFrame_sort_by_exprs`(ptr)
e$`with_columns` <- `PlRLazyFrame_with_columns`(ptr)
e$`to_dot` <- `PlRLazyFrame_to_dot`(ptr)
e$`sort` <- `PlRLazyFrame_sort`(ptr)
e$`top_k` <- `PlRLazyFrame_top_k`(ptr)
e$`bottom_k` <- `PlRLazyFrame_bottom_k`(ptr)
e$`cache` <- `PlRLazyFrame_cache`(ptr)
e$`profile` <- `PlRLazyFrame_profile`(ptr)
e$`sink_parquet` <- `PlRLazyFrame_sink_parquet`(ptr)
e$`sink_ipc` <- `PlRLazyFrame_sink_ipc`(ptr)
e$`sink_csv` <- `PlRLazyFrame_sink_csv`(ptr)
e$`sink_json` <- `PlRLazyFrame_sink_json`(ptr)
e$`serialize` <- `PlRLazyFrame_serialize`(ptr)
e$`select_seq` <- `PlRLazyFrame_select_seq`(ptr)
e$`rolling` <- `PlRLazyFrame_rolling`(ptr)
e$`group_by_dynamic` <- `PlRLazyFrame_group_by_dynamic`(ptr)
e$`with_context` <- `PlRLazyFrame_with_context`(ptr)
e$`join_asof` <- `PlRLazyFrame_join_asof`(ptr)
e$`join` <- `PlRLazyFrame_join`(ptr)
e$`join_where` <- `PlRLazyFrame_join_where`(ptr)
e$`with_columns_seq` <- `PlRLazyFrame_with_columns_seq`(ptr)
e$`rename` <- `PlRLazyFrame_rename`(ptr)
e$`reverse` <- `PlRLazyFrame_reverse`(ptr)
e$`shift` <- `PlRLazyFrame_shift`(ptr)
e$`fill_nan` <- `PlRLazyFrame_fill_nan`(ptr)
e$`fill_null` <- `PlRLazyFrame_fill_null`(ptr)
e$`min` <- `PlRLazyFrame_min`(ptr)
e$`max` <- `PlRLazyFrame_max`(ptr)
e$`sum` <- `PlRLazyFrame_sum`(ptr)
e$`mean` <- `PlRLazyFrame_mean`(ptr)
e$`std` <- `PlRLazyFrame_std`(ptr)
e$`var` <- `PlRLazyFrame_var`(ptr)
e$`median` <- `PlRLazyFrame_median`(ptr)
e$`quantile` <- `PlRLazyFrame_quantile`(ptr)
e$`explode` <- `PlRLazyFrame_explode`(ptr)
e$`null_count` <- `PlRLazyFrame_null_count`(ptr)
e$`unique` <- `PlRLazyFrame_unique`(ptr)
e$`drop_nulls` <- `PlRLazyFrame_drop_nulls`(ptr)
e$`unpivot` <- `PlRLazyFrame_unpivot`(ptr)
e$`with_row_index` <- `PlRLazyFrame_with_row_index`(ptr)
e$`clone` <- `PlRLazyFrame_clone`(ptr)
e$`unnest` <- `PlRLazyFrame_unnest`(ptr)
e$`count` <- `PlRLazyFrame_count`(ptr)
e$`merge_sorted` <- `PlRLazyFrame_merge_sorted`(ptr)

class(e) <- c("PlRLazyFrame", "savvy_neopolars__sealed")
e
Expand Down
29 changes: 29 additions & 0 deletions R/dataframe-frame.R
Original file line number Diff line number Diff line change
Expand Up @@ -539,3 +539,32 @@ dataframe__rechunk <- function() {
self$`_df`$rechunk()
})
}

#' @inherit lazyframe__unnest title description params
#' @inherit as_polars_df return
#' @examples
#' df <- pl$DataFrame(
#' a = 1:5,
#' b = c("one", "two", "three", "four", "five"),
#' c = 6:10
#' )$
#' select(
#' pl$struct("b"),
#' a_and_c = pl$struct(c("a", "c"))
#' )
#' df
#'
#' df$unnest("a_and_c")
dataframe__unnest <- function(...) {
wrap({
check_dots_unnamed()
dots <- list2(...)

if (is_list_of_string(dots)) {
dots <- unlist(dots)
} else {
abort("All elements of `...` must be strings.")
}
self$`_df`$unnest(dots)
})
}
Loading