mbutrovich commented on code in PR #3354:
URL: https://github.com/apache/iceberg-rust/pull/3354#discussion_r4198189348
##########
crates/iceberg/src/spec/manifest_list/writer.rs:
##########
@@ -149,7 +149,8 @@ impl ManifestListWriter {
FormatVersion::V2 => &MANIFEST_LIST_AVRO_SCHEMA_V2,
FormatVersion::V3 => &MANIFEST_LIST_AVRO_SCHEMA_V3,
};
- let mut avro_writer = Writer::new(avro_schema, Vec::new());
+ let mut avro_writer = Writer::new(avro_schema, Vec::new())
+ .expect("Manifest list Avro schemas have no named references to
resolve.");
Review Comment:
> The surrounding fn returns `Result`, so I'd just `?` it with an error map
for consistency.
If I'm reading it right, `ManifestListWriter::new` returns `Self`, and so do
the public `v1`, `v2`, and `v3` constructors that call it
([`writer.rs#L58-L157`](https://github.com/apache/iceberg-rust/blob/ecba0b537a1f78ec8125c1a26f6dfab3f95b509e/crates/iceberg/src/spec/manifest_list/writer.rs#L58-L157)).
Using `?` would make all three fallible, which breaks the public API. 0.22's
`Writer::new` fails only when it can't resolve the schema's names, and the
three manifest list schemas are static. The `expect` matches the existing one
for `add_user_metadata` a few lines below it. Would you be OK keeping it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]