Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgazelka committed Dec 19, 2024
1 parent 6961366 commit a7e1e31
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/daft-connect/src/translation/expr/unresolved_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ pub fn handle_sum(arguments: Vec<daft_dsl::ExprRef>) -> eyre::Result<daft_dsl::E
Ok(arg.sum())
}

pub fn one(arguments: Vec<daft_dsl::ExprRef>) -> eyre::Result<daft_dsl::ExprRef> {
/// If the arguments are exactly one, return it. Otherwise, return an error.
pub fn to_single(arguments: Vec<daft_dsl::ExprRef>) -> eyre::Result<daft_dsl::ExprRef> {
let arguments: [daft_dsl::ExprRef; 1] = match arguments.try_into() {
Ok(arguments) => arguments,
Err(arguments) => {
Expand All @@ -64,7 +65,7 @@ pub fn one(arguments: Vec<daft_dsl::ExprRef>) -> eyre::Result<daft_dsl::ExprRef>
}

pub fn not(arguments: Vec<daft_dsl::ExprRef>) -> eyre::Result<daft_dsl::ExprRef> {
let arg = one(arguments)?;
let arg = to_single(arguments)?;
Ok(arg.not())
}

Expand Down

0 comments on commit a7e1e31

Please sign in to comment.