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

chore: fix clippy #1558

Merged
merged 2 commits into from
Sep 3, 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
8 changes: 4 additions & 4 deletions src/compute/cast/primitive_to.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@
x.map(|x| {
let datetime = timestamp_ns_to_datetime(*x);
let offset = timezone.offset_from_utc_datetime(&datetime);
chrono::DateTime::<T>::from_utc(datetime, offset).to_rfc3339()
chrono::DateTime::<T>::from_naive_utc_and_offset(datetime, offset).to_rfc3339()
})
});
Utf8Array::from_trusted_len_iter(iter)
Expand All @@ -443,7 +443,7 @@
x.map(|x| {
let datetime = timestamp_us_to_datetime(*x);
let offset = timezone.offset_from_utc_datetime(&datetime);
chrono::DateTime::<T>::from_utc(datetime, offset).to_rfc3339()
chrono::DateTime::<T>::from_naive_utc_and_offset(datetime, offset).to_rfc3339()

Check warning on line 446 in src/compute/cast/primitive_to.rs

View check run for this annotation

Codecov / codecov/patch

src/compute/cast/primitive_to.rs#L446

Added line #L446 was not covered by tests
})
});
Utf8Array::from_trusted_len_iter(iter)
Expand All @@ -453,7 +453,7 @@
x.map(|x| {
let datetime = timestamp_ms_to_datetime(*x);
let offset = timezone.offset_from_utc_datetime(&datetime);
chrono::DateTime::<T>::from_utc(datetime, offset).to_rfc3339()
chrono::DateTime::<T>::from_naive_utc_and_offset(datetime, offset).to_rfc3339()

Check warning on line 456 in src/compute/cast/primitive_to.rs

View check run for this annotation

Codecov / codecov/patch

src/compute/cast/primitive_to.rs#L456

Added line #L456 was not covered by tests
})
});
Utf8Array::from_trusted_len_iter(iter)
Expand All @@ -463,7 +463,7 @@
x.map(|x| {
let datetime = timestamp_s_to_datetime(*x);
let offset = timezone.offset_from_utc_datetime(&datetime);
chrono::DateTime::<T>::from_utc(datetime, offset).to_rfc3339()
chrono::DateTime::<T>::from_naive_utc_and_offset(datetime, offset).to_rfc3339()

Check warning on line 466 in src/compute/cast/primitive_to.rs

View check run for this annotation

Codecov / codecov/patch

src/compute/cast/primitive_to.rs#L466

Added line #L466 was not covered by tests
})
});
Utf8Array::from_trusted_len_iter(iter)
Expand Down
16 changes: 12 additions & 4 deletions src/compute/temporal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,31 +288,39 @@
let op = |x| {
let datetime = timestamp_s_to_datetime(x);
let offset = timezone.offset_from_utc_datetime(&datetime);
extract(chrono::DateTime::<T>::from_utc(datetime, offset))
extract(chrono::DateTime::<T>::from_naive_utc_and_offset(
datetime, offset,
))
};
unary(array, op, A::PRIMITIVE.into())
}
TimeUnit::Millisecond => {
let op = |x| {
let datetime = timestamp_ms_to_datetime(x);
let offset = timezone.offset_from_utc_datetime(&datetime);
extract(chrono::DateTime::<T>::from_utc(datetime, offset))
extract(chrono::DateTime::<T>::from_naive_utc_and_offset(
datetime, offset,
))

Check warning on line 303 in src/compute/temporal.rs

View check run for this annotation

Codecov / codecov/patch

src/compute/temporal.rs#L301-L303

Added lines #L301 - L303 were not covered by tests
};
unary(array, op, A::PRIMITIVE.into())
}
TimeUnit::Microsecond => {
let op = |x| {
let datetime = timestamp_us_to_datetime(x);
let offset = timezone.offset_from_utc_datetime(&datetime);
extract(chrono::DateTime::<T>::from_utc(datetime, offset))
extract(chrono::DateTime::<T>::from_naive_utc_and_offset(
datetime, offset,
))
};
unary(array, op, A::PRIMITIVE.into())
}
TimeUnit::Nanosecond => {
let op = |x| {
let datetime = timestamp_ns_to_datetime(x);
let offset = timezone.offset_from_utc_datetime(&datetime);
extract(chrono::DateTime::<T>::from_utc(datetime, offset))
extract(chrono::DateTime::<T>::from_naive_utc_and_offset(
datetime, offset,
))
};
unary(array, op, A::PRIMITIVE.into())
}
Expand Down
Loading