BlakeOrth commented on code in PR #18004:
URL: https://github.com/apache/datafusion/pull/18004#discussion_r2421405815
##########
datafusion-cli/src/command.rs:
##########
@@ -244,3 +277,52 @@ impl OutputFormat {
}
}
}
+
+#[cfg(test)]
+mod tests {
+ use datafusion::{
+ execution::object_store::DefaultObjectStoreRegistry,
prelude::SessionContext,
+ };
+
+ use crate::{
+ object_storage::instrumented::{
+ InstrumentedObjectStoreMode, InstrumentedObjectStoreRegistry,
+ },
+ print_options::MaxRows,
+ };
+
+ use super::*;
+
+ #[tokio::test]
+ async fn command_execute_profile_mode() {
+ let ctx = SessionContext::new();
+
+ let profile_mode = InstrumentedObjectStoreMode::default();
+ let instrumented_registry =
Arc::new(InstrumentedObjectStoreRegistry::new(
+ Arc::new(DefaultObjectStoreRegistry::new()),
+ profile_mode,
+ ));
+ let mut print_options = PrintOptions {
+ format: PrintFormat::Automatic,
+ quiet: false,
+ maxrows: MaxRows::Unlimited,
+ color: true,
+ instrumented_registry: Arc::clone(&instrumented_registry),
+ };
+
+ let mut cmd: Command = "object_store_profiling"
+ .parse()
+ .expect("expected parse to succeed");
+ assert!(cmd.execute(&ctx, &mut print_options).await.is_ok());
Review Comment:
Great catch. I had implemented this test prior to being able to inspect
`mode()` (it was a private element with no accessor) and never revisited.
--
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]