Skip to content

Commit

Permalink
fix: report error when not literal
Browse files Browse the repository at this point in the history
  • Loading branch information
discord9 committed Aug 27, 2024
1 parent 498b02e commit 5934212
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/flow/src/expr/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ impl UnaryFunc {
}.fail()?
}
};

// start time argument is optional
let start_time = match args.get(2) {
Some(start_time) => {
if let Some(value) = start_time.expr.as_literal() {
Expand All @@ -367,7 +369,10 @@ impl UnaryFunc {
})?;
Some(ret)
} else {
None
UnexpectedSnafu {
reason: "Expect start time arg to be literal",
}
.fail()?
}
}
None => None,
Expand Down

0 comments on commit 5934212

Please sign in to comment.