Skip to content

Commit

Permalink
chore: rename the argument for to match Python Polars
Browse files Browse the repository at this point in the history
  • Loading branch information
eitsupi committed Mar 10, 2024
1 parent 06430ff commit 4fe6d65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion R/extendr-wrappers.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ RPolarsDataFrame$to_struct <- function(name) .Call(wrap__RPolarsDataFrame__to_st

RPolarsDataFrame$unnest <- function(names) .Call(wrap__RPolarsDataFrame__unnest, self, names)

RPolarsDataFrame$partition_by <- function(by, maintain_order, include_keys) .Call(wrap__RPolarsDataFrame__partition_by, self, by, maintain_order, include_keys)
RPolarsDataFrame$partition_by <- function(by, maintain_order, include_key) .Call(wrap__RPolarsDataFrame__partition_by, self, by, maintain_order, include_key)

RPolarsDataFrame$export_stream <- function(stream_ptr) invisible(.Call(wrap__RPolarsDataFrame__export_stream, self, stream_ptr))

Expand Down
13 changes: 4 additions & 9 deletions src/rust/src/rdataframe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,19 +328,14 @@ impl RPolarsDataFrame {
self.lazy().unnest(names)?.collect()
}

pub fn partition_by(
&self,
by: Robj,
maintain_order: Robj,
include_keys: Robj,
) -> RResult<List> {
pub fn partition_by(&self, by: Robj, maintain_order: Robj, include_key: Robj) -> RResult<List> {
let by = robj_to!(Vec, String, by)?;
let maintain_order = robj_to!(bool, maintain_order)?;
let include_keys = robj_to!(bool, include_keys)?;
let include_key = robj_to!(bool, include_key)?;
let out = if maintain_order {
self.0.clone().partition_by_stable(by, include_keys)
self.0.clone().partition_by_stable(by, include_key)
} else {
self.0.partition_by(by, include_keys)
self.0.partition_by(by, include_key)
}
.map_err(polars_to_rpolars_err)?;

Expand Down

0 comments on commit 4fe6d65

Please sign in to comment.