Skip to content

Conversation

@scovich
Copy link
Contributor

@scovich scovich commented Jul 10, 2025

Which issue does this PR close?

Part of

Rationale for this change

An expected use case for variant pathing (e.g. a future variant_get) would be to request a field from a variant value that is expected to be an object, or an element from a variant value that is expected to be an array. Those methods are currently missing.

What changes are included in this PR?

Define Variant::get_object_field and Variant::get_array_element methods that do what they say (returning None if anything mismatches).

Are these changes tested?

New doc tests for the methods.

Are there any user-facing changes?

New public methods on Variant enum.

Copy link
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.

Looks great to me -- thank you @scovich

@alamb alamb merged commit 7c42a83 into apache:main Jul 11, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parquet Changes to the parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants