Skip to content

Commit

Permalink
Merge pull request #83 from pola-rs/fix-lazy-dtype-arg-previous-greater
Browse files Browse the repository at this point in the history
fix lazy dtype in arg_previous_greater
  • Loading branch information
MarcoGorelli authored Oct 1, 2024
2 parents df2d46e + 3ea7312 commit aa2e214
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

1 change: 1 addition & 0 deletions src/arg_previous_greater.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use polars::prelude::*;


pub(crate) fn impl_arg_previous_greater<T>(ca: &ChunkedArray<T>) -> IdxCa
where
T: PolarsNumericType,
Expand Down
12 changes: 10 additions & 2 deletions src/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,16 @@ fn to_julian_date(inputs: &[Series]) -> PolarsResult<Series> {
impl_to_julian_date(s)
}

// todo: can we make this bigidx-dependent?
#[polars_expr(output_type=UInt32)]

fn list_idx_dtype(input_fields: &[Field]) -> PolarsResult<Field> {
let field = Field::new(
input_fields[0].name.clone(),
DataType::List(Box::new(IDX_DTYPE))
);
Ok(field.clone())
}

#[polars_expr(output_type_func=list_idx_dtype)]
fn arg_previous_greater(inputs: &[Series]) -> PolarsResult<Series> {
let ser = &inputs[0];
match ser.dtype() {
Expand Down

0 comments on commit aa2e214

Please sign in to comment.