Skip to content

[Variant] impl FromIterator for VariantPath - #8011

Merged
alamb merged 4 commits into
apache:mainfrom
sdf-jkl:variant-from-iterator
Jul 29, 2025
Merged

alamb merged 4 commits into
apache:mainfrom
sdf-jkl:variant-from-iterator

Conversation

@sdf-jkl

@sdf-jkl sdf-jkl commented Jul 28, 2025

Copy link
Copy Markdown
Member

Which issue does this PR close?

We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax.

Rationale for this change

Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.

What changes are included in this PR?

There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.

Are these changes tested?

We typically require tests for all PRs in order to:

  1. Prevent the code from being accidentally broken by subsequent changes
  2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?

Are there any user-facing changes?

If there are user-facing changes then we may require documentation to be updated before approving the PR.

If there are any breaking changes to public APIs, please call them out.

@github-actions github-actions Bot added the parquet parquet crate label Jul 28, 2025
@sdf-jkl sdf-jkl changed the title Variant from iterator [Variant] impl FromIterator for VariantPath Jul 28, 2025

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @sdf-jkl 🙏 this is great

FYI @scovich

Comment thread parquet-variant/src/path.rs Outdated
Comment on lines 49 to 52
/// let path3 = VariantPath::from_iter([
/// VariantPathElement::field("foo"),
/// VariantPathElement::index(0)
/// ]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe we could show using the collect syntax too -- something like

Suggested change
/// let path3 = VariantPath::from_iter([
/// VariantPathElement::field("foo"),
/// VariantPathElement::index(0)
/// ]);
/// let path3 = [
/// VariantPathElement::field("foo"),
/// VariantPathElement::index(0)
/// ].into_iter().collect::<VariantPath>()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Makes sense

@alamb
alamb merged commit 00a2f73 into apache:main Jul 29, 2025
@sdf-jkl
sdf-jkl deleted the variant-from-iterator branch August 6, 2025 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parquet parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Variant] impl FromIterator fpr VariantPath

2 participants