Skip to content

Commit b420333

Browse files
committed
Deprecate scalar_at for execute_scalar
Signed-off-by: Nicholas Gates <nick@nickgates.com>
1 parent 66e309c commit b420333

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

vortex-array/src/arrays/dict/compute/cast.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ impl CastReduce for Dict {
2121
// TODO(joe): optimize this, could look at accessible values and fill_null not those?
2222
if !dtype.is_nullable()
2323
&& array.values().dtype().is_nullable()
24-
&& matches!(array.values().validity()?, Validity::AllValid)
24+
&& !matches!(
25+
array.values().validity()?,
26+
Validity::NonNullable | Validity::AllValid
27+
)
2528
{
2629
return Ok(None);
2730
}

vortex-array/src/arrays/varbin/builder.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ use vortex_buffer::BufferMut;
77
use vortex_error::vortex_panic;
88

99
use crate::IntoArray;
10+
#[cfg(debug_assertions)]
1011
use crate::LEGACY_SESSION;
12+
#[cfg(debug_assertions)]
1113
use crate::VortexSessionExecute;
1214
use crate::arrays::PrimitiveArray;
1315
use crate::arrays::VarBinArray;
@@ -151,19 +153,13 @@ mod tests {
151153
assert_eq!(array.dtype().nullability(), Nullable);
152154
assert_eq!(
153155
array
154-
.execute_scalar(
155-
0,
156-
&mut VortexSessionExecute::create_execution_ctx(&*LEGACY_SESSION)
157-
)
156+
.execute_scalar(0, &mut LEGACY_SESSION.create_execution_ctx())
158157
.unwrap(),
159158
Scalar::utf8("hello".to_string(), Nullable)
160159
);
161160
assert!(
162161
array
163-
.execute_scalar(
164-
1,
165-
&mut VortexSessionExecute::create_execution_ctx(&*LEGACY_SESSION)
166-
)
162+
.execute_scalar(1, &mut LEGACY_SESSION.create_execution_ctx())
167163
.unwrap()
168164
.is_null()
169165
);

0 commit comments

Comments
 (0)