Skip to content

Commit

Permalink
fix: Fix panic when joining with empty frame (debug only) (#19896)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemanley authored Nov 21, 2024
1 parent eaf9b3f commit f718909
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crates/polars-core/src/frame/column/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,9 @@ impl ScalarColumn {

/// Create a new [`ScalarColumn`] from a `length=1` Series and expand it `length`.
///
/// This will panic if the value cannot be made static or if the series has length `0`.
/// This will panic if the value cannot be made static.
pub fn from_single_value_series(series: Series, length: usize) -> Self {
debug_assert!(series.len() <= 1);
debug_assert!(!series.is_empty() || length == 0);

let value = series.get(0).map_or(AnyValue::Null, |av| av.into_static());
let value = Scalar::new(series.dtype().clone(), value);
Expand Down

0 comments on commit f718909

Please sign in to comment.