blackmwk commented on code in PR #2988:
URL: https://github.com/apache/iceberg-rust/pull/2988#discussion_r3811688717
##########
crates/iceberg/src/spec/table_properties.rs:
##########
@@ -172,94 +144,220 @@ fn parse_parquet_compression(properties:
&HashMap<String, String>) -> Result<Com
})
}
-/// Parse boolean property case insensitively
-/// Rust standard library only accepts "true" and "false", see
https://doc.rust-lang.org/std/primitive.bool.html#method.from_str
-/// Users might accidentally trigger fallback with valid configuration values
such as "False" or "True"
-fn parse_property_bool(
- properties: &HashMap<String, String>,
- key: &str,
- default: bool,
-) -> Result<bool> {
- properties.get(key).map_or(Ok(default), |value| {
- value.to_lowercase().parse::<bool>().map_err(|e| {
- Error::new(
- ErrorKind::DataInvalid,
- format!("Invalid value for {key}: {e}"),
- )
- })
- })
-}
-
/// TableProperties that contains the properties of a table.
-#[derive(Debug)]
+#[derive(Debug, Properties)]
pub struct TableProperties {
/// The number of times to retry a commit.
+ #[property(
+ key = Self::PROPERTY_COMMIT_NUM_RETRIES,
Review Comment:
Make the constants mod constant rather struct constants.
--
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]