Skip to content

Commit 718ffea

Browse files
committed
fixes
Signed-off-by: Robert Kruszewski <github@robertk.io>
1 parent 3552933 commit 718ffea

5 files changed

Lines changed: 25 additions & 22 deletions

File tree

vortex-array/src/arrays/constant/vtable/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,10 @@ fn append_value_or_nulls<B: ArrayBuilder + 'static>(
270270
mod tests {
271271
use rstest::rstest;
272272
use vortex_error::VortexResult;
273-
use vortex_session::VortexSession;
274273

275274
use crate::IntoArray;
276275
use crate::VortexSessionExecute;
276+
use crate::array_session;
277277
use crate::arrays::ConstantArray;
278278
use crate::arrays::constant::vtable::canonical::constant_canonicalize;
279279
use crate::assert_arrays_eq;
@@ -286,7 +286,7 @@ mod tests {
286286

287287
/// Appends `array` into a fresh builder and asserts the result matches `constant_canonicalize`.
288288
fn assert_append_matches_canonical(array: ConstantArray) -> VortexResult<()> {
289-
let mut ctx = VortexSession::empty().create_execution_ctx();
289+
let mut ctx = array_session().create_execution_ctx();
290290

291291
let expected = constant_canonicalize(array.as_view(), &mut ctx)?.into_array();
292292
let mut builder = builder_with_capacity(array.dtype(), array.len());

vortex-array/src/arrays/patched/compute/take.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ mod tests {
133133

134134
use vortex_buffer::buffer;
135135
use vortex_error::VortexResult;
136-
use vortex_session::VortexSession;
137136

138137
use crate::ArrayRef;
139138
use crate::ExecutionCtx;
140139
use crate::IntoArray;
140+
use crate::array_session;
141141
use crate::arrays::Patched;
142142
use crate::arrays::PrimitiveArray;
143143
use crate::assert_arrays_eq;
@@ -158,7 +158,7 @@ mod tests {
158158
None,
159159
)?;
160160

161-
let session = VortexSession::empty();
161+
let session = array_session();
162162
let mut ctx = ExecutionCtx::new(session);
163163

164164
Patched::from_array_and_patches(values, &patches, &mut ctx)?

vortex-array/src/arrays/patched/vtable/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ mod tests {
354354
use vortex_buffer::buffer;
355355
use vortex_buffer::buffer_mut;
356356
use vortex_error::VortexResult;
357-
use vortex_session::VortexSession;
358357
use vortex_session::registry::ReadContext;
359358

360359
use crate::ArrayContext;
@@ -363,6 +362,7 @@ mod tests {
363362
use crate::ExecutionCtx;
364363
use crate::IntoArray;
365364
use crate::LEGACY_SESSION;
365+
use crate::array_session;
366366
use crate::arrays::Patched;
367367
use crate::arrays::PatchedArray;
368368
use crate::arrays::PrimitiveArray;
@@ -389,7 +389,7 @@ mod tests {
389389
)
390390
.unwrap();
391391

392-
let session = VortexSession::empty();
392+
let session = array_session();
393393
let mut ctx = ExecutionCtx::new(session);
394394

395395
let array = Patched::from_array_and_patches(values, &patches, &mut ctx)
@@ -422,7 +422,7 @@ mod tests {
422422
)
423423
.unwrap();
424424

425-
let session = VortexSession::empty();
425+
let session = array_session();
426426
let mut ctx = ExecutionCtx::new(session);
427427

428428
let array = Patched::from_array_and_patches(values, &patches, &mut ctx)
@@ -455,7 +455,7 @@ mod tests {
455455
)
456456
.unwrap();
457457

458-
let session = VortexSession::empty();
458+
let session = array_session();
459459
let mut ctx = ExecutionCtx::new(session);
460460

461461
let array = Patched::from_array_and_patches(values, &patches, &mut ctx)
@@ -488,7 +488,7 @@ mod tests {
488488
)
489489
.unwrap();
490490

491-
let session = VortexSession::empty();
491+
let session = array_session();
492492
let mut ctx = ExecutionCtx::new(session);
493493

494494
let array = Patched::from_array_and_patches(values, &patches, &mut ctx)
@@ -525,7 +525,7 @@ mod tests {
525525
)
526526
.unwrap();
527527

528-
let session = VortexSession::empty();
528+
let session = array_session();
529529
let mut ctx = ExecutionCtx::new(session);
530530

531531
let array = Patched::from_array_and_patches(values, &patches, &mut ctx)
@@ -569,7 +569,7 @@ mod tests {
569569

570570
let patches = Patches::new(len, 0, indices, patch_vals, None)?;
571571

572-
let session = VortexSession::empty();
572+
let session = array_session();
573573
let mut ctx = ExecutionCtx::new(session);
574574

575575
Patched::from_array_and_patches(array, &patches, &mut ctx)
@@ -646,7 +646,7 @@ mod tests {
646646
assert_eq!(array_ref.dtype(), new_array.dtype());
647647

648648
// Execute both and compare results
649-
let mut ctx = ExecutionCtx::new(VortexSession::empty());
649+
let mut ctx = ExecutionCtx::new(array_session());
650650
let original_executed = array_ref.execute::<Canonical>(&mut ctx)?.into_primitive();
651651
let new_executed = new_array.execute::<Canonical>(&mut ctx)?.into_primitive();
652652

@@ -672,7 +672,7 @@ mod tests {
672672
let new_array = array_ref.with_slots(slots.into_slots())?;
673673

674674
// Execute and verify the inner values changed (except at patch positions)
675-
let mut ctx = ExecutionCtx::new(VortexSession::empty());
675+
let mut ctx = ExecutionCtx::new(array_session());
676676
let executed = new_array.execute::<Canonical>(&mut ctx)?.into_primitive();
677677

678678
// Expected: all 5s except indices 1, 2, 3 which are patched to 10, 20, 30

vortex-array/src/arrays/patched/vtable/operations.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ impl OperationsVTable<Patched> for Patched {
5858
#[cfg(test)]
5959
mod tests {
6060
use vortex_buffer::buffer;
61-
use vortex_session::VortexSession;
6261

6362
use crate::ExecutionCtx;
6463
use crate::IntoArray;
6564
use crate::LEGACY_SESSION;
6665
use crate::VortexSessionExecute;
66+
use crate::array_session;
6767
use crate::arrays::Patched;
6868
use crate::dtype::Nullability;
6969
use crate::optimizer::ArrayOptimizer;
@@ -82,7 +82,7 @@ mod tests {
8282
)
8383
.unwrap();
8484

85-
let session = VortexSession::empty();
85+
let session = array_session();
8686
let mut ctx = ExecutionCtx::new(session);
8787

8888
let array = Patched::from_array_and_patches(values, &patches, &mut ctx)
@@ -127,7 +127,7 @@ mod tests {
127127
)
128128
.unwrap();
129129

130-
let session = VortexSession::empty();
130+
let session = array_session();
131131
let mut ctx = ExecutionCtx::new(session);
132132

133133
let array = Patched::from_array_and_patches(values, &patches, &mut ctx)
@@ -159,7 +159,7 @@ mod tests {
159159
)
160160
.unwrap();
161161

162-
let session = VortexSession::empty();
162+
let session = array_session();
163163
let mut ctx = ExecutionCtx::new(session);
164164

165165
let array = Patched::from_array_and_patches(values, &patches, &mut ctx)

vortex-array/src/executor.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ use vortex_error::VortexResult;
2626
use vortex_error::vortex_bail;
2727
use vortex_error::vortex_ensure;
2828
use vortex_error::vortex_panic;
29-
use vortex_session::SessionExt;
3029
use vortex_session::VortexSession;
3130

3231
use crate::AnyCanonical;
@@ -203,7 +202,7 @@ impl ArrayRef {
203202
&& let Some(result) = try_execute_parent(
204203
&frame.parent_array,
205204
std::iter::once((frame.slot_idx, &current_array)),
206-
&kernels,
205+
kernels,
207206
ctx,
208207
)?
209208
{
@@ -215,8 +214,12 @@ impl ArrayRef {
215214

216215
// Step 2b: execute_parent against current_array's own children.
217216
if current_builder.is_none()
218-
&& let Some(rewritten) =
219-
try_execute_parent(&current_array, occupied_slots(&current_array), &kernels, ctx)?
217+
&& let Some(rewritten) = try_execute_parent(
218+
&current_array,
219+
occupied_slots(&current_array),
220+
kernels,
221+
ctx,
222+
)?
220223
{
221224
current_array = rewritten.optimize_ctx(ctx.session())?;
222225
continue;
@@ -427,7 +430,7 @@ impl Executable for ArrayRef {
427430
let kernels = session.get::<ArrayKernels>();
428431

429432
if let Some(executed_parent) =
430-
try_execute_parent(&array, occupied_slots(&array), &kernels, ctx)?
433+
try_execute_parent(&array, occupied_slots(&array), kernels, ctx)?
431434
{
432435
return Ok(executed_parent);
433436
}

0 commit comments

Comments
 (0)