alamb commented on code in PR #14307:
URL: https://github.com/apache/datafusion/pull/14307#discussion_r1931221864
##########
datafusion/functions/src/math/monotonicity.rs:
##########
@@ -558,3 +558,441 @@ pub fn get_tanh_doc() -> &'static Documentation {
.build()
})
}
+
+#[cfg(test)]
+mod tests {
+ use arrow::compute::SortOptions;
+ use datafusion_common::Result;
+
+ use super::*;
+
+ #[derive(Debug)]
+ struct MonotonicityTestCase {
+ name: &'static str,
+ func: fn(&[ExprProperties]) -> Result<SortProperties>,
+ lower: f64,
+ upper: f64,
+ input_sort: SortProperties,
+ expected: Option<SortProperties>,
+ expect_err: bool,
Review Comment:
It would be nice to have the expected error be a string rather than a bool
Something like
```suggestion
expect_err: Option<&'static str>,
```
That way we can ensure the errors aren't changing unexpectedly
--
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]