alamb commented on code in PR #10661: URL: https://github.com/apache/datafusion/pull/10661#discussion_r1615146751
########## datafusion/core/src/execution/context/mod.rs: ########## @@ -2860,6 +2863,57 @@ mod tests { Ok(()) } + #[tokio::test] + async fn test_register_default_functions() -> Result<()> { + let config = SessionConfig::new(); Review Comment: While I understand the proposal to test with code like `SessionState::new` , I think it is problematic because if SessionState::new is changed, then this test will no longer match what it is doing. I think the core of this test is verifying that there are no duplicate names in the alias lists. Thus, perhaps we could write tests for `all_default_functions`, etc like ```rust let mut names = HashSet::new(); for func in all_default_functions() { assert(names.insert(func.name()).is_none(), "func.name duplicated") for alias in func.aliases() { assert(names.insert(alias).is_none(), "alias duplicated") } } ``` What do you think? -- 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