Skip to content

Commit a7a7738

Browse files
committed
Rename test and update assertions for clarity
Rename the test from `test_cast_to_extension_type` to `test_cast_preserves_extension_metadata` to better reflect its purpose. Replace the arrow.uuid fixture with a neutral extension name "datafusion.test.int64_extension". Update the assertion to check for the new extension name, ensuring that the test remains focused on verifying that cast lowering preserves target field metadata while surfacing extension metadata in the TryCast error path.
1 parent 90922d9 commit a7a7738

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

datafusion/physical-expr/src/planner.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -467,11 +467,17 @@ mod tests {
467467
}
468468

469469
#[test]
470-
fn test_cast_to_extension_type() -> Result<()> {
471-
let extension_field_type =
472-
Arc::new(DataType::Int64.into_nullable_field().with_metadata(
473-
[("ARROW:extension:name".to_string(), "arrow.uuid".to_string())].into(),
474-
));
470+
fn test_cast_preserves_extension_metadata() -> Result<()> {
471+
let extension_name = "datafusion.test.int64_extension";
472+
let extension_field_type = Arc::new(
473+
DataType::Int64.into_nullable_field().with_metadata(
474+
[(
475+
"ARROW:extension:name".to_string(),
476+
extension_name.to_string(),
477+
)]
478+
.into(),
479+
),
480+
);
475481
let expr = col("value");
476482
let schema = Schema::new(vec![Field::new("value", DataType::Int32, false)]);
477483
let df_schema = DFSchema::try_from(schema.clone())?;
@@ -494,7 +500,7 @@ mod tests {
494500
let err =
495501
create_physical_expr(&try_cast_expr, &df_schema, &ExecutionProps::new())
496502
.unwrap_err();
497-
assert!(err.message().contains("arrow.uuid"));
503+
assert!(err.message().contains(extension_name));
498504

499505
Ok(())
500506
}

0 commit comments

Comments
 (0)