Skip to content

Commit

Permalink
Assume correct schema in impl
Browse files Browse the repository at this point in the history
  • Loading branch information
mcrumiller committed Jan 16, 2025
1 parent 29b6992 commit e513cca
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions crates/polars-plan/src/dsl/function_expr/range/linear_space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub(super) fn linear_space(s: &[Column], closed: ClosedInterval) -> PolarsResult
closed,
name.clone(),
),
(mut dt, dt2) if dt.is_temporal() && dt == dt2 => {
(mut dt, _) if dt.is_temporal() => {
let mut start = start.extract::<i64>().unwrap();
let mut end = end.extract::<i64>().unwrap();

Expand All @@ -50,16 +50,7 @@ pub(super) fn linear_space(s: &[Column], closed: ClosedInterval) -> PolarsResult
new_linear_space_f64(start as f64, end as f64, num_samples, closed, name.clone())
.map(|s| s.cast(&dt).unwrap())
},
(dt1, dt2) if !dt1.is_primitive_numeric() || !dt2.is_primitive_numeric() => {
Err(PolarsError::ComputeError(
format!(
"'start' and 'end' have incompatible dtypes, got {:?} and {:?}",
dt1, dt2
)
.into(),
))
},
(_, _) => new_linear_space_f64(
_ => new_linear_space_f64(
start.extract::<f64>().unwrap(),
end.extract::<f64>().unwrap(),
num_samples,
Expand Down

0 comments on commit e513cca

Please sign in to comment.