Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Casting List to String Ignores Format Options #4669

Closed
tustvold opened this issue Aug 9, 2023 · 1 comment · Fixed by #4668
Closed

Casting List to String Ignores Format Options #4669

tustvold opened this issue Aug 9, 2023 · 1 comment · Fixed by #4668
Labels
arrow Changes to the arrow crate bug

Comments

@tustvold
Copy link
Contributor

tustvold commented Aug 9, 2023

Describe the bug

To Reproduce

#[test]
    fn test_list_format_options() {
        let options = CastOptions {
            safe: false,
            format_options: FormatOptions::default().with_null("null"),
        };
        let array = ListArray::from_iter_primitive::<Int32Type, _, _>(vec![
            Some(vec![Some(0), Some(1), Some(2)]),
            Some(vec![Some(0), None, Some(2)]),
        ]);
        let a = cast_with_options(&array, &DataType::Utf8, &options).unwrap();
        let r: Vec<_> = a.as_string::<i32>().iter().map(|x| x.unwrap()).collect();
        assert_eq!(r, &["[0, 1, 2]", "[0, null, 2]"]);
    }

Expected behavior

Additional context

@tustvold tustvold added the bug label Aug 9, 2023
@tustvold tustvold added the arrow Changes to the arrow crate label Aug 15, 2023
@tustvold
Copy link
Contributor Author

label_issue.py automatically added labels {'arrow'} from #4668

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant