nuno-faria commented on code in PR #27214:
URL: https://github.com/apache/datafusion/pull/27214#discussion_r4529705289


##########
datafusion/functions/src/datetime/date_part.rs:
##########
@@ -987,4 +994,19 @@ mod tests {
             assert!(field.is_nullable());
         }
     }
+
+    #[test]
+    fn test_months_to_seconds() {
+        // (months, seconds) as PostgreSQL 18 and DuckDB return them
+        for (months, seconds) in [
+            (0, 0.0),
+            (11, 28_512_000.0),
+            (12, 31_557_600.0),
+            (14, 36_741_600.0),
+            (-14, -36_741_600.0),
+            (24, 63_115_200.0),
+        ] {
+            assert_eq!(super::months_to_seconds(months), seconds, "{months} 
months");
+        }
+    }

Review Comment:
   Since this does the same as the sqllogictests, I don't think it is necessary.



-- 
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]

Reply via email to