**Is your feature request related to a problem or challenge? Please describe what you are trying to do.** While working on upgrading to DF 43 I discovered that casting support for utf8view <-> bool has not been implemented **Describe the solution you'd like** Support casting to/from bool with utf8view's **Additional context** arrow-cast/src/cast/mod.rs ``` #[test] fn test_cast_utf8view_to_bool() { let strings = StringViewArray::from(vec!["true", "false", "invalid", " Y ", ""]); let casted = cast(&strings, &DataType::Boolean).unwrap(); let expected = BooleanArray::from(vec![Some(true), Some(false), None, Some(true), None]); assert_eq!(*as_boolean_array(&casted), expected); } #[test] fn test_cast_with_options_utf8view_to_bool() { let strings = StringViewArray::from(vec!["true", "false", "invalid", " Y ", ""]); let casted = cast_with_options( &strings, &DataType::Boolean, &CastOptions { safe: false, format_options: FormatOptions::default(), }, ); match casted { Ok(_) => panic!("expected error"), Err(e) => { assert!(e .to_string() .contains("Cast error: Cannot cast value 'invalid' to value of Boolean type")) } } } #[test] fn test_cast_bool_to_utf8view() { let array = BooleanArray::from(vec![Some(true), Some(false), None]); let b = cast(&array, &DataType::Utf8View).unwrap(); let c = b.as_any().downcast_ref::<StringViewArray>().unwrap(); assert_eq!("true", c.value(0)); assert_eq!("false", c.value(1)); assert!(!c.is_valid(2)); } ```
Activity
tlm365 commentedon Nov 11, 2024
take
alamb commentedon Dec 17, 2024
label_issue.pyautomatically added labels {'arrow'} from #6822