Skip to content

Commit

Permalink
chore: Revert "Merge commit 'a4c2e28579b8b02b119541a9d173b291072cca4b…
Browse files Browse the repository at this point in the history
…' into wasm" to try to fix wasm build error

This reverts commit 95860cc, reversing
changes made to c1a262c.
  • Loading branch information
eitsupi committed Jan 11, 2025
1 parent 3198fb2 commit 4bb474e
Show file tree
Hide file tree
Showing 14 changed files with 161 additions and 498 deletions.
21 changes: 0 additions & 21 deletions R/000-wrappers.R
Original file line number Diff line number Diff line change
Expand Up @@ -3494,12 +3494,6 @@ class(`PlRLazyGroupBy`) <- c("PlRLazyGroupBy__bundle", "savvy_neopolars__sealed"
}
}

`PlRSeries_can_fast_explode_flag` <- function(self) {
function() {
.Call(savvy_PlRSeries_can_fast_explode_flag__impl, `self`)
}
}

`PlRSeries_cast` <- function(self) {
function(`dtype`, `strict`) {
`dtype` <- .savvy_extract_ptr(`dtype`, "PlRDataType")
Expand Down Expand Up @@ -3551,18 +3545,6 @@ class(`PlRLazyGroupBy`) <- c("PlRLazyGroupBy__bundle", "savvy_neopolars__sealed"
}
}

`PlRSeries_is_sorted_ascending_flag` <- function(self) {
function() {
.Call(savvy_PlRSeries_is_sorted_ascending_flag__impl, `self`)
}
}

`PlRSeries_is_sorted_descending_flag` <- function(self) {
function() {
.Call(savvy_PlRSeries_is_sorted_descending_flag__impl, `self`)
}
}

`PlRSeries_len` <- function(self) {
function() {
.Call(savvy_PlRSeries_len__impl, `self`)
Expand Down Expand Up @@ -3649,7 +3631,6 @@ class(`PlRLazyGroupBy`) <- c("PlRLazyGroupBy__bundle", "savvy_neopolars__sealed"
e <- new.env(parent = emptyenv())
e$.ptr <- ptr
e$`add` <- `PlRSeries_add`(ptr)
e$`can_fast_explode_flag` <- `PlRSeries_can_fast_explode_flag`(ptr)
e$`cast` <- `PlRSeries_cast`(ptr)
e$`cat_is_local` <- `PlRSeries_cat_is_local`(ptr)
e$`cat_to_local` <- `PlRSeries_cat_to_local`(ptr)
Expand All @@ -3658,8 +3639,6 @@ class(`PlRLazyGroupBy`) <- c("PlRLazyGroupBy__bundle", "savvy_neopolars__sealed"
e$`div` <- `PlRSeries_div`(ptr)
e$`dtype` <- `PlRSeries_dtype`(ptr)
e$`equals` <- `PlRSeries_equals`(ptr)
e$`is_sorted_ascending_flag` <- `PlRSeries_is_sorted_ascending_flag`(ptr)
e$`is_sorted_descending_flag` <- `PlRSeries_is_sorted_descending_flag`(ptr)
e$`len` <- `PlRSeries_len`(ptr)
e$`mul` <- `PlRSeries_mul`(ptr)
e$`n_chunks` <- `PlRSeries_n_chunks`(ptr)
Expand Down
21 changes: 1 addition & 20 deletions R/dataframe-frame.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,6 @@
#' - `shape`: `$shape` returns a integer vector of length two with the number of rows and columns of the DataFrame.
#' - `height`: `$height` returns a integer with the number of rows of the DataFrame.
#' - `width`: `$width` returns a integer with the number of columns of the DataFrame.
#' - `flags`: `$flags` returns a list with column names as names and a named
#' logical vector with the flags as values.
#'
#' @section Flags:
#'
#' Flags are used internally to avoid doing unnecessary computations, such as
#' sorting a variable that we know is already sorted. The number of flags
#' varies depending on the column type: columns of type `array` and `list`
#' have the flags `SORTED_ASC`, `SORTED_DESC`, and `FAST_EXPLODE`, while other
#' column types only have the former two.
#'
#' - `SORTED_ASC` is set to `TRUE` when we sort a column in increasing order, so
#' that we can use this information later on to avoid re-sorting it.
#' - `SORTED_DESC` is similar but applies to sort in decreasing order.
#'
#' @param ... <[`dynamic-dots`][rlang::dyn-dots]>
#' Name-value pairs of objects to be converted to polars [Series]
#' by the [as_polars_series()] function.
Expand Down Expand Up @@ -103,6 +88,7 @@ wrap.PlRDataFrame <- function(x, ...) {
self <- new.env(parent = emptyenv())
self$`_df` <- x

# TODO: flags
makeActiveBinding("columns", function() self$`_df`$columns(), self)
makeActiveBinding("dtypes", function() {
self$`_df`$dtypes() |>
Expand All @@ -112,11 +98,6 @@ wrap.PlRDataFrame <- function(x, ...) {
makeActiveBinding("shape", function() self$`_df`$shape(), self)
makeActiveBinding("height", function() self$`_df`$height(), self)
makeActiveBinding("width", function() self$`_df`$width(), self)
makeActiveBinding(
"flags",
function() lapply(self$get_columns(), \(x) x$flags),
self
)

lapply(names(polars_dataframe__methods), function(name) {
fn <- polars_dataframe__methods[[name]]
Expand Down
14 changes: 0 additions & 14 deletions R/series-series.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,6 @@ wrap.PlRSeries <- function(x, ...) {
makeActiveBinding("dtype", function() self$`_s`$dtype() |> wrap(), self)
makeActiveBinding("name", function() self$`_s`$name(), self)
makeActiveBinding("shape", function() c(wrap(self$`_s`$len()), 1L), self)
makeActiveBinding(
"flags",
function() {
out <- c(
SORTED_ASC = self$`_s`$is_sorted_ascending_flag(),
SORTED_DESC = self$`_s`$is_sorted_descending_flag()
)
if (inherits(self$dtype, "polars_dtype_list")) {
out["FAST_EXPLODE"] <- self$`_s`$can_fast_explode_flag()
}
out
},
self
)

lapply(names(polars_series__methods), function(name) {
fn <- polars_series__methods[[name]]
Expand Down
17 changes: 0 additions & 17 deletions man/pl__DataFrame.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -2349,11 +2349,6 @@ SEXP savvy_PlRSeries_add__impl(SEXP self__, SEXP c_arg__other) {
return handle_result(res);
}

SEXP savvy_PlRSeries_can_fast_explode_flag__impl(SEXP self__) {
SEXP res = savvy_PlRSeries_can_fast_explode_flag__ffi(self__);
return handle_result(res);
}

SEXP savvy_PlRSeries_cast__impl(SEXP self__, SEXP c_arg__dtype, SEXP c_arg__strict) {
SEXP res = savvy_PlRSeries_cast__ffi(self__, c_arg__dtype, c_arg__strict);
return handle_result(res);
Expand Down Expand Up @@ -2394,16 +2389,6 @@ SEXP savvy_PlRSeries_equals__impl(SEXP self__, SEXP c_arg__other, SEXP c_arg__ch
return handle_result(res);
}

SEXP savvy_PlRSeries_is_sorted_ascending_flag__impl(SEXP self__) {
SEXP res = savvy_PlRSeries_is_sorted_ascending_flag__ffi(self__);
return handle_result(res);
}

SEXP savvy_PlRSeries_is_sorted_descending_flag__impl(SEXP self__) {
SEXP res = savvy_PlRSeries_is_sorted_descending_flag__ffi(self__);
return handle_result(res);
}

SEXP savvy_PlRSeries_len__impl(SEXP self__) {
SEXP res = savvy_PlRSeries_len__ffi(self__);
return handle_result(res);
Expand Down Expand Up @@ -3009,7 +2994,6 @@ static const R_CallMethodDef CallEntries[] = {
{"savvy_PlRLazyGroupBy_head__impl", (DL_FUNC) &savvy_PlRLazyGroupBy_head__impl, 2},
{"savvy_PlRLazyGroupBy_tail__impl", (DL_FUNC) &savvy_PlRLazyGroupBy_tail__impl, 2},
{"savvy_PlRSeries_add__impl", (DL_FUNC) &savvy_PlRSeries_add__impl, 2},
{"savvy_PlRSeries_can_fast_explode_flag__impl", (DL_FUNC) &savvy_PlRSeries_can_fast_explode_flag__impl, 1},
{"savvy_PlRSeries_cast__impl", (DL_FUNC) &savvy_PlRSeries_cast__impl, 3},
{"savvy_PlRSeries_cat_is_local__impl", (DL_FUNC) &savvy_PlRSeries_cat_is_local__impl, 1},
{"savvy_PlRSeries_cat_to_local__impl", (DL_FUNC) &savvy_PlRSeries_cat_to_local__impl, 1},
Expand All @@ -3018,8 +3002,6 @@ static const R_CallMethodDef CallEntries[] = {
{"savvy_PlRSeries_div__impl", (DL_FUNC) &savvy_PlRSeries_div__impl, 2},
{"savvy_PlRSeries_dtype__impl", (DL_FUNC) &savvy_PlRSeries_dtype__impl, 1},
{"savvy_PlRSeries_equals__impl", (DL_FUNC) &savvy_PlRSeries_equals__impl, 5},
{"savvy_PlRSeries_is_sorted_ascending_flag__impl", (DL_FUNC) &savvy_PlRSeries_is_sorted_ascending_flag__impl, 1},
{"savvy_PlRSeries_is_sorted_descending_flag__impl", (DL_FUNC) &savvy_PlRSeries_is_sorted_descending_flag__impl, 1},
{"savvy_PlRSeries_len__impl", (DL_FUNC) &savvy_PlRSeries_len__impl, 1},
{"savvy_PlRSeries_mul__impl", (DL_FUNC) &savvy_PlRSeries_mul__impl, 2},
{"savvy_PlRSeries_n_chunks__impl", (DL_FUNC) &savvy_PlRSeries_n_chunks__impl, 1},
Expand Down
Loading

0 comments on commit 4bb474e

Please sign in to comment.