Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion committed Aug 29, 2024
1 parent 328179c commit ea4f56f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 41 deletions.
35 changes: 0 additions & 35 deletions crates/polars-core/src/chunked_array/ops/explode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,41 +297,6 @@ mod test {
Ok(())
}

#[test]
fn test_explode_list_nulls() -> PolarsResult<()> {
let ca = Int32Chunked::from_slice_options(
PlSmallStr::const_default(),
&[None, Some(1), Some(2)],
);
let offsets = &[0, 3, 3];
let out = ca.explode_by_offsets(offsets);
assert_eq!(
Vec::from(out.i32().unwrap()),
&[None, Some(1), Some(2), None]
);

let ca = BooleanChunked::from_slice_options(
PlSmallStr::const_default(),
&[None, Some(true), Some(false)],
);
let out = ca.explode_by_offsets(offsets);
assert_eq!(
Vec::from(out.bool().unwrap()),
&[None, Some(true), Some(false), None]
);

let ca = StringChunked::from_slice_options(
PlSmallStr::const_default(),
&[None, Some("b"), Some("c")],
);
let out = ca.explode_by_offsets(offsets);
assert_eq!(
Vec::from(out.str().unwrap()),
&[None, Some("b"), Some("c"), None]
);
Ok(())
}

#[test]
fn test_explode_empty_list_slot() -> PolarsResult<()> {
// primitive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl ListChunked {
// SAFETY: inner_dtype should be correct
let values = unsafe {
Series::from_chunks_and_dtype_unchecked(
self.name(),
self.name().clone(),
vec![values],
&self.inner_dtype().to_physical(),
)
Expand Down Expand Up @@ -178,7 +178,7 @@ impl ChunkExplode for ListChunked {
// SAFETY: inner_dtype should be correct
let s = unsafe {
Series::from_chunks_and_dtype_unchecked(
self.name(),
self.name().clone(),
vec![chunk],
&self.inner_dtype().to_physical(),
)
Expand Down
2 changes: 1 addition & 1 deletion crates/polars-ops/src/series/ops/search_sorted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub fn search_sorted(
})
})
.collect();
Ok(IdxCa::new_vec(s.name(), idxs))
Ok(IdxCa::new_vec(s.name().clone(), idxs))
},
DataType::Binary => {
let ca = s.binary().unwrap();
Expand Down
2 changes: 1 addition & 1 deletion crates/polars-plan/src/plans/builder_dsl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ impl DslBuilder {
predicate_pd: optimizations.contains(OptFlags::PREDICATE_PUSHDOWN),
projection_pd: optimizations.contains(OptFlags::PROJECTION_PUSHDOWN),
streamable: optimizations.contains(OptFlags::STREAMING),
fmt_str: name.into(),
fmt_str: name,
}),
}
.into()
Expand Down
4 changes: 2 additions & 2 deletions crates/polars-stream/src/physical_plan/lower_ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use polars_core::prelude::{InitHashMaps, PlHashMap, PlIndexMap};
use polars_core::schema::{IndexOfSchema, Schema};
use polars_error::PolarsResult;
use polars_plan::plans::expr_ir::{ExprIR, OutputName};
use polars_plan::plans::{AExpr, ColumnName, IR};
use polars_plan::plans::{AExpr, IR};
use polars_plan::prelude::SinkType;
use polars_utils::arena::{Arena, Node};
use polars_utils::itertools::Itertools;
Expand All @@ -26,7 +26,7 @@ pub fn lower_ir(
let output_schema = IR::schema_with_cache(node, ir_arena, schema_cache);
let node_kind = match ir_node {
IR::SimpleProjection { input, columns } => {
let columns = columns.iter_names().map(|s| s.to_string()).collect();
let columns = columns.get_names_owned();
let phys_input = lower_ir(
*input,
ir_arena,
Expand Down

0 comments on commit ea4f56f

Please sign in to comment.