From 9229b535231c2488bec35a3e15936e59e1fbb3de Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Sat, 10 Aug 2024 14:53:12 -0400 Subject: [PATCH] fmt --- vegafusion-common/src/datatypes.rs | 6 +++++- vegafusion-sql/src/dataframe/mod.rs | 15 +++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/vegafusion-common/src/datatypes.rs b/vegafusion-common/src/datatypes.rs index 3546802b..a91b55ce 100644 --- a/vegafusion-common/src/datatypes.rs +++ b/vegafusion-common/src/datatypes.rs @@ -40,7 +40,11 @@ pub fn is_integer_datatype(dtype: &DataType) -> bool { pub fn is_float_datatype(dtype: &DataType) -> bool { matches!( dtype, - DataType::Float16 | DataType::Float32 | DataType::Float64 | DataType::Decimal128(_, _) | DataType::Decimal256(_, _) + DataType::Float16 + | DataType::Float32 + | DataType::Float64 + | DataType::Decimal128(_, _) + | DataType::Decimal256(_, _) ) } diff --git a/vegafusion-sql/src/dataframe/mod.rs b/vegafusion-sql/src/dataframe/mod.rs index 90d22029..b5025cc1 100644 --- a/vegafusion-sql/src/dataframe/mod.rs +++ b/vegafusion-sql/src/dataframe/mod.rs @@ -1148,8 +1148,9 @@ impl SqlDataFrame { Ok(if col_name == field { coalesce(vec![ flat_col(field).cast_to(&value.data_type(), &self.schema_df()?)?, - lit(value.clone()) - ]).alias(col_name) + lit(value.clone()), + ]) + .alias(col_name) } else { flat_col(col_name) }) @@ -1192,8 +1193,9 @@ impl SqlDataFrame { Ok(if col_name == field { coalesce(vec![ flat_col(field).cast_to(&value.data_type(), &self.schema_df()?)?, - lit(value.clone()) - ]).alias(col_name) + lit(value.clone()), + ]) + .alias(col_name) } else { flat_col(col_name) }) @@ -1209,8 +1211,9 @@ impl SqlDataFrame { let expr = if col_name == field { coalesce(vec![ flat_col(field).cast_to(&value.data_type(), &self.schema_df()?)?, - lit(value.clone()) - ]).alias(col_name) + lit(value.clone()), + ]) + .alias(col_name) } else if col_name == key { Expr::Column(Column { relation: Some(TableReference::bare("_key")),