mbrobbel commented on code in PR #3099: URL: https://github.com/apache/arrow-adbc/pull/3099#discussion_r2189337450
########## rust/core/src/driver_manager.rs: ########## @@ -316,6 +408,65 @@ impl Driver for ManagedDriver { } } +fn get_optional_key(manifest: &Table, key: &str) -> String { + manifest + .get(key) + .and_then(Value::as_str) + .unwrap_or_default() + .to_string() +} + +fn load_driver_manifest(info: &mut DriverInfo) -> Result<()> { + let contents = fs::read_to_string(info.manifest_file.as_path()).map_err(|e| { + let file = info.manifest_file.to_string_lossy(); + Error::with_message_and_status( + format!("Could not read manifest '{file}': {e}"), + Status::InvalidArguments, + ) + })?; + + let manifest = contents + .parse::<Table>() + .map_err(|e| Error::with_message_and_status(e.to_string(), Status::InvalidArguments))?; Review Comment: > Is that maybe overkill given that we aren't looking to provide full manifest interactions, just a simple parse to get the shared lib path? By providing a `Manifest` definition (behind a feature flag) users can easily use the other fields, because even if we don't use those other fields here now, others might. > How do I modify that to express that the `shared` member could be _either_ a string or a `map<string, string>` that maps platform triples to a path? https://serde.rs/string-or-struct.html > PLEASE let's not include `serde`. TOML was chosen as the format for manifests and that's the only ser/de format that the driver manager will need. `serde` doesn't include other data formats (`Deserializer` implementations)? > better abstractions Can you elaborate? -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org