zeroshade commented on code in PR #3099: URL: https://github.com/apache/arrow-adbc/pull/3099#discussion_r2190373384
########## 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: I don't think we can put the manifest handling behind a feature flag as it's necessary for the driver_manager itself (or maybe we just make the driver_manager feature depend on the manifest feature?) I'll poke around with this, in the meantime you two (@felipecrv @mbrobbel) can fight over whether or not to use `serde` as I don't know the lib enough to know the pros/cons :smile: I'll go with whichever wins :) -- 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