Skip to content

[Variant] Add ObjectBuilder::with_field for convenience - #7950

Merged
alamb merged 1 commit into
apache:mainfrom
alamb:alamb/object_builder_with_field
Jul 18, 2025
Merged

alamb merged 1 commit into
apache:mainfrom
alamb:alamb/object_builder_with_field

Conversation

@alamb

@alamb alamb commented Jul 17, 2025

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

I would like it to be easier / more ergonomic to make objects

What changes are included in this PR?

  1. Add ObjectBuilder::with_field
  2. Add documentation w/ examples
  3. Rewrite some tests

Are these changes tested?

Yes, by doc tests

Are there any user-facing changes?

Yes a new API

@alamb alamb changed the title Alamb/object builder with field [Variant] Add ObjectBuilder::with_field for convenience Jul 17, 2025
@github-actions github-actions Bot added the parquet parquet crate label Jul 17, 2025

@codephage2020 codephage2020 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 for your excellent suggestions and PR! They helped me complete this #7959 much faster. Really appreciate it! 🚀

By the way, should the new API be recommended as a preference? If so, we need to modify some examples, such as:

https://github.com/apache/arrow-rs/blob/main/parquet-variant/src/variant.rs#L940-L962

https://github.com/apache/arrow-rs/blob/main/parquet-variant/src/variant.rs#L999-L1024

@alamb

alamb commented Jul 18, 2025 •

Copy link
Copy Markdown
Contributor Author

By the way, should the new API be recommended as a preference? If so, we need to modify some examples, such as:

I am not sure -- I suspect different people will have different preferences.

If you would like to update the examples I would be happy to review the pR

@alamb

alamb commented Jul 18, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for the review @codephage2020

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] Add ObjectBuilder::with_field for convenience

2 participants