Skip to content

Commit

Permalink
test(12733): update metadata preservation test, for new contract (a.k…
Browse files Browse the repository at this point in the history
….a. cast preserves field metadata)
  • Loading branch information
wiedld committed Nov 9, 2024
1 parent f04ed2b commit 141c3f0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions datafusion/expr/src/expr_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -682,13 +682,11 @@ mod tests {
.with_data_type(DataType::Int32)
.with_metadata(meta.clone());

// col and alias should be metadata-preserving
// col, alias, and cast should be metadata-preserving
assert_eq!(meta, expr.metadata(&schema).unwrap());
assert_eq!(meta, expr.clone().alias("bar").metadata(&schema).unwrap());

// cast should drop input metadata since the type has changed
assert_eq!(
HashMap::new(),
meta,
expr.clone()
.cast_to(&DataType::Int64, &schema)
.unwrap()
Expand Down

0 comments on commit 141c3f0

Please sign in to comment.