You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Dandandan (via GitHub)" <gi...@apache.org> on 2023/07/01 08:54:12 UTC

[GitHub] [arrow-datafusion] Dandandan commented on a diff in pull request #6815: Fix timestamp_add_interval_months to pass any date

Dandandan commented on code in PR #6815:
URL: https://github.com/apache/arrow-datafusion/pull/6815#discussion_r1248712026


##########
datafusion/core/tests/sql/timestamp.rs:
##########
@@ -579,8 +579,8 @@ async fn timestamp_add_interval_months() -> Result<()> {
     let t1_naive = chrono::NaiveDateTime::parse_from_str(res1, format).unwrap();
     let t2_naive = chrono::NaiveDateTime::parse_from_str(res2, format).unwrap();
 
-    let year = t1_naive.year() + (t1_naive.month() as i32 + 17) / 12;
-    let month = (t1_naive.month() + 17) % 12;
+    let year = t1_naive.year() + (t1_naive.month0() as i32 + 17) / 12;

Review Comment:
   Instead of using `NOW()` we could use some table of dates instead to test it?.



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org