diff --git a/R/functions__lazy.R b/R/functions__lazy.R index a121a4585..ae26a65f6 100644 --- a/R/functions__lazy.R +++ b/R/functions__lazy.R @@ -1313,10 +1313,6 @@ pl_arg_sort_by = function( #' pl$all() #' ) pl_int_range = function(start = 0, end = NULL, step = 1, ..., dtype = pl$Int64) { - if (!dtype$is_integer()) { - Err_plain("`dtype` must be of type integer") |> - unwrap("in pl$int_range():") - } if (is.null(end)) { end = start start = 0 @@ -1342,10 +1338,6 @@ pl_int_range = function(start = 0, end = NULL, step = 1, ..., dtype = pl$Int64) #' #' df$with_columns(int_range = pl$int_ranges("start", "end", dtype = pl$Int16)) pl_int_ranges = function(start = 0, end = NULL, step = 1, ..., dtype = pl$Int64) { - if (!dtype$is_integer()) { - Err_plain("`dtype` must be of type integer") |> - unwrap("in pl$int_ranges():") - } if (is.null(end)) { end = start start = 0 diff --git a/src/rust/src/rlib.rs b/src/rust/src/rlib.rs index a3b9e71c6..b31edb78b 100644 --- a/src/rust/src/rlib.rs +++ b/src/rust/src/rlib.rs @@ -423,7 +423,13 @@ pub fn int_ranges(start: Robj, end: Robj, step: Robj, dtype: Robj) -> RResult as_polars_series(), - "must be of type integer" + "non-integer `dtype` passed" ) expect_grepl_error( pl$int_range(0, 3, dtype = pl$Float32) |> as_polars_series(), - "must be of type integer" + "non-integer `dtype` passed" ) # "step" works @@ -612,7 +612,7 @@ test_that("pl$int_ranges() works", { expect_grepl_error( df$select(int_range = pl$int_ranges("start", "end", dtype = pl$String)), - "must be of type integer" + "non-integer `dtype` passed" ) # "step" works