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

fix: Field nullability mismatch when converting struct arrays to arrow #2174

Merged
merged 5 commits into from
Jan 31, 2025

Conversation

AdamGS
Copy link
Contributor

@AdamGS AdamGS commented Jan 31, 2025

seems to be part of issues I ran into as part of #2155.

@AdamGS AdamGS requested a review from gatesn January 31, 2025 16:28
@AdamGS AdamGS changed the title fix: Fix field nullability when converting struct arrays to arrow fix: Field nullability mismatch when converting struct arrays to arrow Jan 31, 2025
@AdamGS AdamGS requested a review from gatesn January 31, 2025 17:12
@AdamGS AdamGS enabled auto-merge (squash) January 31, 2025 17:21
@@ -24,6 +26,8 @@ impl ToArrowFn<StructArray> for StructEncoding {
.iter()
.zip_eq(array.children())
.map(|(field, arr)| {
let target_dtype = DType::from_arrow(field.as_ref());
let arr = try_cast(arr, &target_dtype)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add one more check, target_dtype.eq_ignore_nullability(arr.dtype()) - just to make sure we're only doing null casting?

And leave a comment as to why

@AdamGS AdamGS merged commit 6bb4149 into develop Jan 31, 2025
20 checks passed
@AdamGS AdamGS deleted the adamg/fix-struct-to-arrow-field-nullability branch January 31, 2025 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants