Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pomo-mondreganto committed Aug 5, 2024
1 parent b211cd1 commit bb4cf5a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/polars-sql/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1255,9 +1255,9 @@ impl SQLFunctionVisitor<'_> {
Median => self.visit_unary(Expr::median),
Quantile => {
let args = extract_args(function)?;
let getValue = |e: Expr| match e {
let get_value = |e: Expr| match e {
Expr::Literal(LiteralValue::Float(f)) => {
if f >= 0.0 && f <= 1.0 {
if (0.0..=1.0).contains(&f) {
Ok(Expr::from(f))
} else {
polars_bail!(SQLSyntax: "QUANTILE value must be between 0 and 1 ({})", args[1])
Expand All @@ -1268,11 +1268,11 @@ impl SQLFunctionVisitor<'_> {

match args.len() {
2 => self.try_visit_binary(|e, q| {
Ok(e.quantile(getValue(q)?, QuantileInterpolOptions::Nearest))
Ok(e.quantile(get_value(q)?, QuantileInterpolOptions::Nearest))
}),
3 => self.try_visit_ternary(|e, q, opt| {
Ok(e.quantile(
getValue(q)?,
get_value(q)?,
match opt {
Expr::Literal(LiteralValue::String(s)) => {
QuantileInterpolOptions::from_str(&s)?
Expand Down

0 comments on commit bb4cf5a

Please sign in to comment.