Skip to content

Commit

Permalink
feat: add missing functions and docs for LazyFrame
Browse files Browse the repository at this point in the history
Co-authored-by: eitsupi <ts1s1andn@gmail.com>
  • Loading branch information
etiennebacher and eitsupi authored Feb 14, 2025
1 parent ecb8170 commit 2721c63
Show file tree
Hide file tree
Showing 60 changed files with 5,117 additions and 4 deletions.
273 changes: 273 additions & 0 deletions R/000-wrappers.R
Original file line number Diff line number Diff line change
Expand Up @@ -3307,6 +3307,18 @@ class(`PlRExpr`) <- c("PlRExpr__bundle", "savvy_neopolars__sealed")

### wrapper functions for PlRLazyFrame

`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_cast` <- function(self) {
function(`dtypes`, `strict`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_cast__impl, `self`, `dtypes`, `strict`))
Expand All @@ -3320,6 +3332,12 @@ class(`PlRExpr`) <- c("PlRExpr__bundle", "savvy_neopolars__sealed")
}
}

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

`PlRLazyFrame_collect` <- function(self) {
function() {
.savvy_wrap_PlRDataFrame(.Call(savvy_PlRLazyFrame_collect__impl, `self`))
Expand All @@ -3332,6 +3350,12 @@ class(`PlRExpr`) <- c("PlRExpr__bundle", "savvy_neopolars__sealed")
}
}

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

`PlRLazyFrame_describe_optimized_plan` <- function(self) {
function() {
.Call(savvy_PlRLazyFrame_describe_optimized_plan__impl, `self`)
Expand Down Expand Up @@ -3362,6 +3386,32 @@ class(`PlRExpr`) <- c("PlRExpr__bundle", "savvy_neopolars__sealed")
}
}

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

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

`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_filter` <- function(self) {
function(`predicate`) {
`predicate` <- .savvy_extract_ptr(`predicate`, "PlRExpr")
Expand All @@ -3375,62 +3425,285 @@ class(`PlRExpr`) <- c("PlRExpr__bundle", "savvy_neopolars__sealed")
}
}

`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_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_asof` <- function(self) {
function(`other`, `left_on`, `right_on`, `allow_parallel`, `force_parallel`, `suffix`, `coalesce`, `strategy`, `allow_eq`, `check_sortedness`, `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")
`tolerance` <- .savvy_extract_ptr(`tolerance`, "PlRSeries")
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_join_asof__impl, `self`, `other`, `left_on`, `right_on`, `allow_parallel`, `force_parallel`, `suffix`, `coalesce`, `strategy`, `allow_eq`, `check_sortedness`, `left_by`, `right_by`, `tolerance`, `tolerance_str`))
}
}

`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_max` <- function(self) {
function() {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_max__impl, `self`))
}
}

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

`PlRLazyFrame_median` <- function(self) {
function() {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_median__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`))
}
}

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

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

`PlRLazyFrame_optimization_toggle` <- function(self) {
function(`type_coercion`, `predicate_pushdown`, `projection_pushdown`, `simplify_expression`, `slice_pushdown`, `comm_subplan_elim`, `comm_subexpr_elim`, `cluster_with_columns`, `streaming`, `_eager`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_optimization_toggle__impl, `self`, `type_coercion`, `predicate_pushdown`, `projection_pushdown`, `simplify_expression`, `slice_pushdown`, `comm_subplan_elim`, `comm_subexpr_elim`, `cluster_with_columns`, `streaming`, `_eager`))
}
}

`PlRLazyFrame_profile` <- function(self) {
function() {
.Call(savvy_PlRLazyFrame_profile__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_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_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_select` <- function(self) {
function(`exprs`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_select__impl, `self`, `exprs`))
}
}

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

`PlRLazyFrame_serialize` <- function(self) {
function() {
.Call(savvy_PlRLazyFrame_serialize__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_slice` <- function(self) {
function(`offset`, `len` = NULL) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_slice__impl, `self`, `offset`, `len`))
}
}

`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_sort_by_exprs` <- function(self) {
function(`by`, `descending`, `nulls_last`, `maintain_order`, `multithreaded`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_sort_by_exprs__impl, `self`, `by`, `descending`, `nulls_last`, `maintain_order`, `multithreaded`))
}
}

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

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

`PlRLazyFrame_tail` <- function(self) {
function(`n`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_tail__impl, `self`, `n`))
}
}

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

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

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

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

`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_var` <- function(self) {
function(`ddof`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_var__impl, `self`, `ddof`))
}
}

`PlRLazyFrame_with_columns` <- function(self) {
function(`exprs`) {
.savvy_wrap_PlRLazyFrame(.Call(savvy_PlRLazyFrame_with_columns__impl, `self`, `exprs`))
}
}

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

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

`.savvy_wrap_PlRLazyFrame` <- function(ptr) {
e <- new.env(parent = emptyenv())
e$.ptr <- ptr
e$`bottom_k` <- `PlRLazyFrame_bottom_k`(ptr)
e$`cache` <- `PlRLazyFrame_cache`(ptr)
e$`cast` <- `PlRLazyFrame_cast`(ptr)
e$`cast_all` <- `PlRLazyFrame_cast_all`(ptr)
e$`clone` <- `PlRLazyFrame_clone`(ptr)
e$`collect` <- `PlRLazyFrame_collect`(ptr)
e$`collect_schema` <- `PlRLazyFrame_collect_schema`(ptr)
e$`count` <- `PlRLazyFrame_count`(ptr)
e$`describe_optimized_plan` <- `PlRLazyFrame_describe_optimized_plan`(ptr)
e$`describe_optimized_plan_tree` <- `PlRLazyFrame_describe_optimized_plan_tree`(ptr)
e$`describe_plan` <- `PlRLazyFrame_describe_plan`(ptr)
e$`describe_plan_tree` <- `PlRLazyFrame_describe_plan_tree`(ptr)
e$`drop` <- `PlRLazyFrame_drop`(ptr)
e$`drop_nulls` <- `PlRLazyFrame_drop_nulls`(ptr)
e$`explode` <- `PlRLazyFrame_explode`(ptr)
e$`fill_nan` <- `PlRLazyFrame_fill_nan`(ptr)
e$`fill_null` <- `PlRLazyFrame_fill_null`(ptr)
e$`filter` <- `PlRLazyFrame_filter`(ptr)
e$`group_by` <- `PlRLazyFrame_group_by`(ptr)
e$`group_by_dynamic` <- `PlRLazyFrame_group_by_dynamic`(ptr)
e$`join` <- `PlRLazyFrame_join`(ptr)
e$`join_asof` <- `PlRLazyFrame_join_asof`(ptr)
e$`join_where` <- `PlRLazyFrame_join_where`(ptr)
e$`max` <- `PlRLazyFrame_max`(ptr)
e$`mean` <- `PlRLazyFrame_mean`(ptr)
e$`median` <- `PlRLazyFrame_median`(ptr)
e$`merge_sorted` <- `PlRLazyFrame_merge_sorted`(ptr)
e$`min` <- `PlRLazyFrame_min`(ptr)
e$`null_count` <- `PlRLazyFrame_null_count`(ptr)
e$`optimization_toggle` <- `PlRLazyFrame_optimization_toggle`(ptr)
e$`profile` <- `PlRLazyFrame_profile`(ptr)
e$`quantile` <- `PlRLazyFrame_quantile`(ptr)
e$`rename` <- `PlRLazyFrame_rename`(ptr)
e$`reverse` <- `PlRLazyFrame_reverse`(ptr)
e$`rolling` <- `PlRLazyFrame_rolling`(ptr)
e$`select` <- `PlRLazyFrame_select`(ptr)
e$`select_seq` <- `PlRLazyFrame_select_seq`(ptr)
e$`serialize` <- `PlRLazyFrame_serialize`(ptr)
e$`shift` <- `PlRLazyFrame_shift`(ptr)
e$`slice` <- `PlRLazyFrame_slice`(ptr)
e$`sort` <- `PlRLazyFrame_sort`(ptr)
e$`sort_by_exprs` <- `PlRLazyFrame_sort_by_exprs`(ptr)
e$`std` <- `PlRLazyFrame_std`(ptr)
e$`sum` <- `PlRLazyFrame_sum`(ptr)
e$`tail` <- `PlRLazyFrame_tail`(ptr)
e$`to_dot` <- `PlRLazyFrame_to_dot`(ptr)
e$`top_k` <- `PlRLazyFrame_top_k`(ptr)
e$`unique` <- `PlRLazyFrame_unique`(ptr)
e$`unnest` <- `PlRLazyFrame_unnest`(ptr)
e$`unpivot` <- `PlRLazyFrame_unpivot`(ptr)
e$`var` <- `PlRLazyFrame_var`(ptr)
e$`with_columns` <- `PlRLazyFrame_with_columns`(ptr)
e$`with_columns_seq` <- `PlRLazyFrame_with_columns_seq`(ptr)
e$`with_row_index` <- `PlRLazyFrame_with_row_index`(ptr)

class(e) <- c("PlRLazyFrame", "savvy_neopolars__sealed")
e
Expand Down
Loading

0 comments on commit 2721c63

Please sign in to comment.