Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Datum Arithmetic tests, Fix Interval Substraction (#4480) #4493

Merged
merged 4 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions arrow-arith/src/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ mod tests {
let c = c.as_any().downcast_ref::<Date32Array>().unwrap();
assert_eq!(
c.value(0),
Date32Type::from_naive_date(NaiveDate::from_ymd_opt(2023, 3, 27).unwrap())
Date32Type::from_naive_date(NaiveDate::from_ymd_opt(2023, 3, 28).unwrap())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous logic was incorrect but happened to give a potentially plausible result. I'm not sure what the correct rounding behaviour is here though

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Date32: https://docs.rs/arrow/latest/arrow/datatypes/enum.IntervalUnit.html

86500 is milliseconds so 86.5 seconds before 2023-03-29

Thus 2023-03-28 seems much more correct to me

);
}

Expand Down Expand Up @@ -1364,7 +1364,7 @@ mod tests {
let c = c.as_any().downcast_ref::<Date64Array>().unwrap();
assert_eq!(
c.value(0),
Date64Type::from_naive_date(NaiveDate::from_ymd_opt(2023, 3, 27).unwrap())
Date64Type::from_naive_date(NaiveDate::from_ymd_opt(2023, 3, 28).unwrap())
);
}

Expand Down
Loading
Loading