This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/main by this push:
new 112e58191b Add example of parsing field names as VariantPath (#8945)
112e58191b is described below
commit 112e58191b1004adcb3ee87331c924ea11fd2691
Author: Andrew Lamb <[email protected]>
AuthorDate: Wed Dec 10 12:26:24 2025 -0500
Add example of parsing field names as VariantPath (#8945)
# Which issue does this PR close?
- Related to https://github.com/apache/arrow-rs/pull/8940
# Rationale for this change
When reviewing https://github.com/apache/arrow-rs/pull/8940 it wasn't
clear you could create a `VariantPath` from a string
Thus let's add an example to the documentation
# What changes are included in this PR?
Add an example to the documentation
# Are these changes tested?
Yes, by CI
# Are there any user-facing changes?
Docs only, no functional change
---
parquet-variant/src/path.rs | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/parquet-variant/src/path.rs b/parquet-variant/src/path.rs
index 6ca68dc7c1..a7010ba61c 100644
--- a/parquet-variant/src/path.rs
+++ b/parquet-variant/src/path.rs
@@ -53,6 +53,15 @@ use std::{borrow::Cow, ops::Deref};
/// assert_eq!(path, path3);
/// ```
///
+/// # Example: From Dot notation strings
+/// ```
+/// # use parquet_variant::{VariantPath, VariantPathElement};
+/// /// You can also convert strings directly into paths using dot notation
+/// let path = VariantPath::from("foo.bar.baz");
+/// let expected = VariantPath::from("foo").join("bar").join("baz");
+/// assert_eq!(path, expected);
+/// ```
+///
/// # Example: Accessing Compound paths
/// ```
/// # use parquet_variant::{VariantPath, VariantPathElement};