Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmmease committed Aug 10, 2024
1 parent 0a5073a commit 9229b53
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
6 changes: 5 additions & 1 deletion vegafusion-common/src/datatypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(_, _)
)
}

Expand Down
15 changes: 9 additions & 6 deletions vegafusion-sql/src/dataframe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand Down Expand Up @@ -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)
})
Expand All @@ -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")),
Expand Down

0 comments on commit 9229b53

Please sign in to comment.