Skip to content

Add UnionArray::fields#8884

Merged
alamb merged 1 commit intoapache:mainfrom
pydantic:friendlymatthew/unionarray_fields
Nov 24, 2025
Merged

Add UnionArray::fields#8884
alamb merged 1 commit intoapache:mainfrom
pydantic:friendlymatthew/unionarray_fields

Conversation

@friendlymatthew
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

This PR adds another method on the UnionArray api that returns a list of FieldRefs associated with the union type

See: #8838 (comment)

@github-actions github-actions Bot added the arrow Changes to the arrow crate label Nov 19, 2025
Copy link
Copy Markdown
Contributor Author

@friendlymatthew friendlymatthew left a comment

Choose a reason for hiding this comment

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

Self review

Comment thread arrow-array/src/array/union_array.rs Outdated
Comment on lines 314 to 328
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Turns out we can derive the UnionMode by calling UnionArray::is_dense. But I wonder if a better API would to actually return the enum 🤔

Copy link
Copy Markdown
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

@alamb alamb merged commit 5f3577a into apache:main Nov 24, 2025
26 checks passed
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants