You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The second part of add_month_day_nano is seemingly ignored, so if you try to add like an hour to a Date64Type, you actually get back the same date.
To Reproduce
This test will pass on main, but it shouldn't (added to arrow-array/src/types.rs).
#[cfg(test)]mod tests {usesuper::*;use arrow_data::{layout,BufferSpec};#[test]fnadd_month_day_nano(){let date_64 = Date64Type::default_value();let interval = IntervalMonthDayNanoType::make_value(0,0,1_000_000_000*3600);let result = Date64Type::add_month_day_nano(date_64, interval);// result equals date_64, but should be an hour after.assert_eq!(result, date_64);}}
Expected behavior
For date64s adding increments less than a day should be supported.
Describe the bug
The second part of
add_month_day_nano
is seemingly ignored, so if you try to add like an hour to aDate64Type
, you actually get back the same date.To Reproduce
This test will pass on main, but it shouldn't (added to
arrow-array/src/types.rs
).Expected behavior
For date64s adding increments less than a day should be supported.
Additional context
I think the result is from coercion to a NaiveDate instead of a NaiveDateTime. I have a working branch, I'll open a PR for... https://github.com/apache/arrow-rs/compare/master...tshauck:add-sub-day-increments-to-date64type?expand=1
The text was updated successfully, but these errors were encountered: