Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
arrow2 0.18.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Sep 17, 2023
1 parent 7c93e35 commit 56cd5e9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "arrow2"
version = "0.17.4"
version = "0.18.0"
license = "Apache-2.0"
description = "Unofficial implementation of Apache Arrow spec in safe Rust"
homepage = "https://github.com/jorgecarleitao/arrow2"
Expand Down
4 changes: 2 additions & 2 deletions src/io/csv/read_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ fn deserialize_datetime<T: chrono::TimeZone>(string: &str, tz: &T) -> Option<i64
.to_datetime()
.map(|x| x.naive_utc())
.map(|x| tz.from_utc_datetime(&x))
.map(|x| x.timestamp_nanos())
.map(|x| x.timestamp_nanos_opt().unwrap())
.ok()
} else {
None
Expand Down Expand Up @@ -228,7 +228,7 @@ pub(crate) fn deserialize_column<B: ByteRecordGeneric>(
Timestamp(time_unit, None) => deserialize_primitive(rows, column, datatype, |bytes| {
to_utf8(bytes)
.and_then(|x| x.parse::<chrono::NaiveDateTime>().ok())
.map(|x| x.timestamp_nanos())
.map(|x| x.timestamp_nanos_opt().unwrap())
.map(|x| match time_unit {
TimeUnit::Second => x / 1_000_000_000,
TimeUnit::Millisecond => x / 1_000_000,
Expand Down
4 changes: 2 additions & 2 deletions src/io/odbc/read/deserialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,12 @@ fn timestamp_ms(timestamp: &odbc_api::sys::Timestamp) -> i64 {

fn timestamp_us(timestamp: &odbc_api::sys::Timestamp) -> i64 {
timestamp_to_naive(timestamp)
.map(|x| x.timestamp_nanos() / 1000)
.map(|x| x.timestamp_nanos_opt().unwrap() / 1000)

Check warning on line 267 in src/io/odbc/read/deserialize.rs

View check run for this annotation

Codecov / codecov/patch

src/io/odbc/read/deserialize.rs#L267

Added line #L267 was not covered by tests
.unwrap_or(0)
}

fn timestamp_ns(timestamp: &odbc_api::sys::Timestamp) -> i64 {
timestamp_to_naive(timestamp)
.map(|x| x.timestamp_nanos())
.map(|x| x.timestamp_nanos_opt().unwrap())

Check warning on line 273 in src/io/odbc/read/deserialize.rs

View check run for this annotation

Codecov / codecov/patch

src/io/odbc/read/deserialize.rs#L273

Added line #L273 was not covered by tests
.unwrap_or(0)
}
12 changes: 6 additions & 6 deletions src/temporal_conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ pub fn utf8_to_timestamp_scalar<T: chrono::TimeZone>(
TimeUnit::Second => x.timestamp(),
TimeUnit::Millisecond => x.timestamp_millis(),
TimeUnit::Microsecond => x.timestamp_micros(),
TimeUnit::Nanosecond => x.timestamp_nanos(),
TimeUnit::Nanosecond => x.timestamp_nanos_opt().unwrap(),
})
.ok()
} else {
Expand All @@ -390,7 +390,7 @@ pub fn utf8_to_naive_timestamp_scalar(value: &str, fmt: &str, tu: &TimeUnit) ->
TimeUnit::Second => x.timestamp(),
TimeUnit::Millisecond => x.timestamp_millis(),
TimeUnit::Microsecond => x.timestamp_micros(),
TimeUnit::Nanosecond => x.timestamp_nanos(),
TimeUnit::Nanosecond => x.timestamp_nanos_opt().unwrap(),
})
.ok()
}
Expand Down Expand Up @@ -515,8 +515,8 @@ pub fn add_naive_interval(timestamp: i64, time_unit: TimeUnit, interval: months_
match time_unit {
TimeUnit::Second => new_datetime_tz.timestamp_millis() / 1000,
TimeUnit::Millisecond => new_datetime_tz.timestamp_millis(),
TimeUnit::Microsecond => new_datetime_tz.timestamp_nanos() / 1000,
TimeUnit::Nanosecond => new_datetime_tz.timestamp_nanos(),
TimeUnit::Microsecond => new_datetime_tz.timestamp_nanos_opt().unwrap() / 1000,
TimeUnit::Nanosecond => new_datetime_tz.timestamp_nanos_opt().unwrap(),

Check warning on line 519 in src/temporal_conversions.rs

View check run for this annotation

Codecov / codecov/patch

src/temporal_conversions.rs#L518-L519

Added lines #L518 - L519 were not covered by tests
}
}

Expand Down Expand Up @@ -544,7 +544,7 @@ pub fn add_interval<T: chrono::TimeZone>(
match time_unit {
TimeUnit::Second => new_datetime_tz.timestamp_millis() / 1000,
TimeUnit::Millisecond => new_datetime_tz.timestamp_millis(),
TimeUnit::Microsecond => new_datetime_tz.timestamp_nanos() / 1000,
TimeUnit::Nanosecond => new_datetime_tz.timestamp_nanos(),
TimeUnit::Microsecond => new_datetime_tz.timestamp_nanos_opt().unwrap() / 1000,
TimeUnit::Nanosecond => new_datetime_tz.timestamp_nanos_opt().unwrap(),

Check warning on line 548 in src/temporal_conversions.rs

View check run for this annotation

Codecov / codecov/patch

src/temporal_conversions.rs#L547-L548

Added lines #L547 - L548 were not covered by tests
}
}

0 comments on commit 56cd5e9

Please sign in to comment.