Skip to content

Commit

Permalink
fix lazy dtype in arg_previous_greater
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Sep 30, 2024
1 parent df2d46e commit 3ea7312
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 3ea7312

Please sign in to comment.