Skip to content

Commit 9bdeb28

Browse files
adriangbclaude
andcommitted
docs: document the two proto conversions that changed shape since 54.1.0
`TryFrom<&[PartitionedFile]> for protobuf::FileGroup` becomes a function, and the parquet options conversions are fallible. The crate moves need no entry: trait impls are global, so every other conversion resolves unchanged. Part of apache#24019. Co-Authored-By: Claude Opus 5 <[email protected]>
1 parent 308ab7e commit 9bdeb28

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

  • docs/source/library-user-guide/upgrading

‎docs/source/library-user-guide/upgrading/55.0.0.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,3 +1188,39 @@ See [PR #24030](https://github.com/apache/datafusion/pull/24030) for details.
11881188
[`bufwriter`]: https://docs.rs/tokio/latest/tokio/io/struct.BufWriter.html
11891189
[`asyncarrowwriter`]: https://docs.rs/parquet/59.1.0/parquet/arrow/async_writer/struct.AsyncArrowWriter.html
11901190
[`parquet/examples/object_store.rs`]: https://github.com/apache/arrow-rs/blob/main/parquet/examples/object_store.rs
1191+
1192+
### `datafusion-proto`: `FileGroup` from a slice, and fallible parquet options
1193+
1194+
Two of the `From` / `TryFrom` conversions between DataFusion types and
1195+
`datafusion_proto::protobuf` messages changed shape since 54.1.0. The rest of
1196+
that set converts exactly as before — several impls moved to the crate that owns
1197+
their DataFusion type, but trait impls are global, so `X::try_from(&proto)` and
1198+
`proto.try_into()` still resolve with no import changes.
1199+
1200+
**Who is affected:**
1201+
1202+
- Code building a `protobuf::FileGroup` from a slice of `PartitionedFile`.
1203+
`TryFrom<&[PartitionedFile]>` could not be kept: `&T` is `#[fundamental]` but
1204+
`[T]` is not, so `&[PartitionedFile]` counts as foreign in every crate that
1205+
could host the impl. It is a function now. `TryFrom<&FileGroup>` is unaffected.
1206+
- Code converting `protobuf::ParquetOptions` or `protobuf::TableParquetOptions`
1207+
into their `datafusion-common` counterparts. These validate `writer_version`
1208+
now, so they are `TryFrom` rather than `From`.
1209+
1210+
**Migration guide:**
1211+
1212+
```rust,ignore
1213+
// Before
1214+
let group = protobuf::FileGroup::try_from(files.as_slice())?;
1215+
let opts = ParquetOptions::from(&proto_opts);
1216+
1217+
// After
1218+
use datafusion_proto::physical_plan::to_proto::partitioned_files_to_proto;
1219+
let group = partitioned_files_to_proto(&files)?;
1220+
let opts = ParquetOptions::try_from(&proto_opts)?;
1221+
1222+
// Unchanged: `FileGroup` is a nameable local type, so it keeps the trait impl
1223+
let group = protobuf::FileGroup::try_from(&file_group)?;
1224+
```
1225+
1226+
See [issue #24019](https://github.com/apache/datafusion/issues/24019) for details.

0 commit comments

Comments
 (0)