blackmwk opened a new pull request, #3810: URL: https://github.com/apache/iceberg-rust/pull/3810
## Which issue does this PR close? - Relates to #3094 and #3098. ## What changes are included in this PR? Add a `required` flag option to `#[property(...)]` for both `#[derive(Properties)]` and `properties_view!`, allowing exact-key fields to declare `required` instead of `default = ...`. When a required key is absent, `from_properties` (or the corresponding `properties_view!` getter) returns `ErrorKind::DataInvalid` naming the missing key (`Missing required property: <key>`). When present, the value is parsed normally through `FromStr` or `parse_with`. Invalid combinations (`required` with `default`, `Option<T>`, `nested`, `prefix`, or `parse_properties_with`) are rejected at compile time. ## Are these changes tested? - `cargo test -p iceberg-property-macro --all-targets --all-features` (unit, derive, view, and 28 trybuild compile-fail cases passed) - `cargo test -p iceberg-property-macro --doc --all-features` (3 passed) - `cargo clippy -p iceberg-property-macro --all-targets --all-features -- -D warnings` - `RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features -p iceberg-property-macro` - `cargo public-api -p iceberg-property-macro --all-features -ss | diff - crates/property-macro/public-api.txt` - `cargo fmt --all -- --check`, `python3 ./dev/release/licenses.py crates check`, and `git diff --check` ## AI Disclosure Developed with AI assistance. Review focus: compile-time validation rules for `required` (mutually exclusive with `default`, disallowed on `Option<T>`, `nested`, `prefix`, and `parse_properties_with`), missing-key error handling before invoking `parse_with`, and lazy validation behavior in `properties_view!`. -- 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]
