alamb commented on code in PR #14664: URL: https://github.com/apache/datafusion/pull/14664#discussion_r1957090964
########## datafusion/execution/src/task.rs: ########## @@ -249,6 +251,39 @@ mod tests { assert!(test.is_some()); assert_eq!(test.unwrap().value, 24); + assert_eq!(test.unwrap().option_value, Some(42)); + + Ok(()) + } + + #[test] + fn task_context_extensions_default() -> Result<()> { + let runtime = Arc::new(RuntimeEnv::default()); + let mut extensions = Extensions::new(); + extensions.insert(TestExtension::default()); + + let config = ConfigOptions::new().with_extensions(extensions); + let session_config = SessionConfig::from(config); + + let task_context = TaskContext::new( + Some("task_id".to_string()), + "session_id".to_string(), + session_config, + HashMap::default(), + HashMap::default(), + HashMap::default(), + runtime, + ); + + let test = task_context + .session_config() + .options() + .extensions + .get::<TestExtension>(); + assert!(test.is_some()); + + assert_eq!(test.unwrap().value, 42); + assert_eq!(test.unwrap().option_value, None); Review Comment: 👍 -- 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...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org