Skip to content

Commit fcf3e67

Browse files
committed
make not fallible
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
1 parent c25e331 commit fcf3e67

3 files changed

Lines changed: 1 addition & 20 deletions

File tree

vortex-array/src/scalar_fn/vtable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ pub trait ScalarFnVTable: 'static + Sized + Clone + Send + Sync {
9292
Ok(args.to_vec())
9393
}
9494

95-
// TODO(connor): This needs a precondition for the number of args it has, or all implementations
96-
// need to return an error if it is wrong.
9795
/// Compute the return [`DType`] of the expression if evaluated over the given input types.
9896
///
9997
/// # Preconditions

vortex-tensor/src/scalar_fns/cosine_similarity.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use vortex::dtype::NativePType;
1818
use vortex::dtype::Nullability;
1919
use vortex::error::VortexResult;
2020
use vortex::error::vortex_ensure;
21-
use vortex::error::vortex_ensure_eq;
2221
use vortex::error::vortex_err;
2322
use vortex::expr::Expression;
2423
use vortex::scalar_fn::Arity;
@@ -81,13 +80,6 @@ impl ScalarFnVTable for CosineSimilarity {
8180
}
8281

8382
fn return_dtype(&self, _options: &Self::Options, arg_dtypes: &[DType]) -> VortexResult<DType> {
84-
vortex_ensure_eq!(
85-
arg_dtypes.len(),
86-
2,
87-
"CosineSimilarity requires exactly 2 arguments, got {}",
88-
arg_dtypes.len()
89-
);
90-
9183
let lhs = &arg_dtypes[0];
9284
let rhs = &arg_dtypes[1];
9385

vortex-tensor/src/scalar_fns/l2_norm.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use vortex::dtype::NativePType;
1818
use vortex::dtype::Nullability;
1919
use vortex::error::VortexResult;
2020
use vortex::error::vortex_ensure;
21-
use vortex::error::vortex_ensure_eq;
2221
use vortex::error::vortex_err;
2322
use vortex::expr::Expression;
2423
use vortex::scalar_fn::Arity;
@@ -73,13 +72,6 @@ impl ScalarFnVTable for L2Norm {
7372
}
7473

7574
fn return_dtype(&self, _options: &Self::Options, arg_dtypes: &[DType]) -> VortexResult<DType> {
76-
vortex_ensure_eq!(
77-
arg_dtypes.len(),
78-
1,
79-
"L2Norm requires exactly 2 arguments, got {}",
80-
arg_dtypes.len()
81-
);
82-
8375
let input_dtype = &arg_dtypes[0];
8476

8577
// Input must be a tensor-like extension type.
@@ -146,8 +138,7 @@ impl ScalarFnVTable for L2Norm {
146138
}
147139

148140
fn is_fallible(&self, _options: &Self::Options) -> bool {
149-
// Canonicalization of the storage array can fail.
150-
true
141+
false
151142
}
152143
}
153144

0 commit comments

Comments
 (0)