File tree Expand file tree Collapse file tree
vortex-array/src/scalar_fn
vortex-tensor/src/scalar_fns Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ use vortex::dtype::NativePType;
1818use vortex:: dtype:: Nullability ;
1919use vortex:: error:: VortexResult ;
2020use vortex:: error:: vortex_ensure;
21- use vortex:: error:: vortex_ensure_eq;
2221use vortex:: error:: vortex_err;
2322use vortex:: expr:: Expression ;
2423use 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
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ use vortex::dtype::NativePType;
1818use vortex:: dtype:: Nullability ;
1919use vortex:: error:: VortexResult ;
2020use vortex:: error:: vortex_ensure;
21- use vortex:: error:: vortex_ensure_eq;
2221use vortex:: error:: vortex_err;
2322use vortex:: expr:: Expression ;
2423use 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
You can’t perform that action at this time.
0 commit comments