chore(deps): Bump chrono from 0.4.26 to 0.4.27 (#8607)

* chore(deps): Bump chrono from 0.4.26 to 0.4.27

Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.26 to 0.4.27.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.26...v0.4.27)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: Run cargo hakari tasks

* fix: Update deprecated chrono methods to their now-recommended versions

`chrono::DateTime::<Tz>::from_utc` has been deprecated and it's now
recommended to use `chrono::DateTime::from_naive_utc_and_offset`
instead.

<https://github.com/chronotope/chrono/pull/1175>

Note that the `Timestamp` type in `influxdb_influxql_parser` is an alias
for `chrono::DateTime<FixedOffset>`.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: Carol (Nichols || Goulding) <carol.nichols@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
pull/24376/head
dependabot[bot] 2023-08-31 09:18:25 +00:00 committed by GitHub
parent a4567a80e6
commit 4ce11fd9f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 16 additions and 16 deletions

6
Cargo.lock generated
View File

@ -806,15 +806,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
version = "0.4.26"
version = "0.4.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5"
checksum = "f56b4c72906975ca04becb8a30e102dfecddd0c06181e3e95ddc444be28881f8"
dependencies = [
"android-tzdata",
"iana-time-zone",
"num-traits",
"serde",
"winapi",
"windows-targets 0.48.5",
]
[[package]]

View File

@ -40,7 +40,7 @@ fn array_value_to_string(column: &ArrayRef, row: usize) -> Result<String> {
)
})?;
// treat as UTC
let ts = DateTime::<Utc>::from_utc(ts, Utc);
let ts = DateTime::<Utc>::from_naive_utc_and_offset(ts, Utc);
// convert to string in preferred influx format
let use_z = true;
Ok(ts.to_rfc3339_opts(SecondsFormat::AutoSi, use_z))

View File

@ -358,7 +358,7 @@ pub(crate) fn literal_regex(i: &str) -> ParseResult<&str, Literal> {
pub fn nanos_to_timestamp(nanos: i64) -> Timestamp {
let (secs, nsec) = num_integer::div_mod_floor(nanos, NANOS_PER_SEC);
Timestamp::from_utc(
Timestamp::from_naive_utc_and_offset(
NaiveDateTime::from_timestamp_opt(secs, nsec as u32)
.expect("unable to convert duration to timestamp"),
chrono::Utc.fix(),

View File

@ -732,7 +732,7 @@ mod test {
/// and not timezone.
fn reduce_context() -> ReduceContext {
ReduceContext {
now: Some(Timestamp::from_utc(
now: Some(Timestamp::from_naive_utc_and_offset(
NaiveDateTime::new(
NaiveDate::from_ymd_opt(2023, 1, 1).unwrap(),
NaiveTime::from_hms_opt(0, 0, 0).unwrap(),
@ -892,7 +892,7 @@ mod test {
let cond: ConditionalExpression =
s.parse().expect("unexpected error parsing expression");
let ctx = ReduceContext {
now: Some(Timestamp::from_utc(
now: Some(Timestamp::from_naive_utc_and_offset(
NaiveDateTime::new(
NaiveDate::from_ymd_opt(2004, 4, 9).unwrap(),
NaiveTime::from_hms_opt(12, 13, 14).unwrap(),

View File

@ -22,7 +22,7 @@ fn parse_timestamp_utc(s: &str) -> Option<Timestamp> {
NaiveDate::parse_from_str(s, "%Y-%m-%d")
.map(|nd| nd.and_time(NaiveTime::default())),
)
.map(|ts| DateTime::from_utc(ts, chrono::Utc.fix()))
.map(|ts| DateTime::from_naive_utc_and_offset(ts, chrono::Utc.fix()))
.ok()
}

View File

@ -669,7 +669,7 @@ mod test {
.unwrap()
.and_hms_opt(0, 0, 0)
.unwrap();
let start_time = DateTime::<Utc>::from_utc(start_time, Utc);
let start_time = DateTime::<Utc>::from_naive_utc_and_offset(start_time, Utc);
let mut props = ExecutionProps::new();
props.query_execution_start_time = start_time;
props

View File

@ -144,7 +144,7 @@ impl Default for MockSchemaProvider {
.unwrap()
.and_hms_opt(0, 0, 0)
.unwrap();
let start_time = DateTime::<Utc>::from_utc(start_time, Utc);
let start_time = DateTime::<Utc>::from_naive_utc_and_offset(start_time, Utc);
let mut execution_props = ExecutionProps::new();
execution_props.query_execution_start_time = start_time;
let mut res = Self {

View File

@ -7,7 +7,7 @@ edition.workspace = true
license.workspace = true
[dependencies]
chrono = { version = "0.4.26", default-features = false, features = ["clock", "std"] }
chrono = { version = "0.4.27", default-features = false, features = ["clock", "std"] }
parking_lot = "0.12"
tokio = { version = "1.32", features = ["macros", "parking_lot", "rt-multi-thread", "sync", "time"] }
workspace-hack = { version = "0.1", path = "../workspace-hack" }

View File

@ -146,7 +146,7 @@ fn timestamp_to_datetime(ts: i64) -> DateTime<Utc> {
// Note that nsec as u32 is safe here because modulo on a negative ts value
// still produces a positive remainder.
let datetime = NaiveDateTime::from_timestamp_opt(secs, nsec as u32).expect("ts in range");
DateTime::from_utc(datetime, Utc)
DateTime::from_naive_utc_and_offset(datetime, Utc)
}
/// Original: <https://github.com/influxdata/flux/blob/1e9bfd49f21c0e679b42acf6fc515ce05c6dec2b/values/time.go#L491>
@ -198,7 +198,7 @@ fn to_timestamp_nanos_utc(
NaiveTime::from_hms_nano_opt(hour, min, sec, nano).expect("hour-min-sec-nano in range");
let ndatetime = NaiveDateTime::new(ndate, ntime);
let datetime = DateTime::<Utc>::from_utc(ndatetime, Utc);
let datetime = DateTime::<Utc>::from_naive_utc_and_offset(ndatetime, Utc);
datetime.timestamp_nanos()
}

View File

@ -48,7 +48,7 @@ workspace-hack = { version = "0.1", path = "../workspace-hack" }
[dev-dependencies]
assert_matches = "1.5"
base64 = "0.21.3"
chrono = { version = "0.4.26", default-features = false }
chrono = { version = "0.4.27", default-features = false }
criterion = { version = "0.5", default-features = false, features = [
"async_tokio",
"rayon",

View File

@ -196,14 +196,14 @@ rustls = { version = "0.21" }
once_cell = { version = "1", default-features = false, features = ["unstable"] }
rustls = { version = "0.21" }
scopeguard = { version = "1" }
winapi = { version = "0.3", default-features = false, features = ["basetsd", "cfg", "combaseapi", "consoleapi", "errhandlingapi", "evntrace", "fileapi", "handleapi", "heapapi", "ifdef", "in6addr", "inaddr", "ioapiset", "iphlpapi", "lmaccess", "lmapibuf", "lmcons", "memoryapi", "minwinbase", "minwindef", "netioapi", "ntlsa", "ntsecapi", "objidl", "oleauto", "pdh", "powerbase", "processenv", "psapi", "rpcdce", "sddl", "securitybaseapi", "shellapi", "std", "stringapiset", "synchapi", "sysinfoapi", "timezoneapi", "wbemcli", "winbase", "wincon", "windef", "winerror", "winioctl", "winnt", "winsock2", "winuser", "ws2ipdef", "ws2tcpip", "wtypesbase"] }
winapi = { version = "0.3", default-features = false, features = ["basetsd", "cfg", "combaseapi", "consoleapi", "errhandlingapi", "evntrace", "fileapi", "handleapi", "heapapi", "ifdef", "in6addr", "inaddr", "ioapiset", "iphlpapi", "lmaccess", "lmapibuf", "lmcons", "memoryapi", "minwinbase", "minwindef", "netioapi", "ntlsa", "ntsecapi", "objidl", "oleauto", "pdh", "powerbase", "processenv", "psapi", "rpcdce", "sddl", "securitybaseapi", "shellapi", "std", "stringapiset", "synchapi", "sysinfoapi", "wbemcli", "winbase", "wincon", "windef", "winerror", "winioctl", "winnt", "winsock2", "winuser", "ws2ipdef", "ws2tcpip", "wtypesbase"] }
windows-sys = { version = "0.48", features = ["Win32_Foundation", "Win32_Networking_WinSock", "Win32_Security", "Win32_Storage_FileSystem", "Win32_System_Console", "Win32_System_Diagnostics_Debug", "Win32_System_IO", "Win32_System_Pipes", "Win32_System_Registry", "Win32_System_SystemServices", "Win32_System_Threading", "Win32_System_Time", "Win32_System_WindowsProgramming", "Win32_UI_Shell"] }
[target.x86_64-pc-windows-msvc.build-dependencies]
once_cell = { version = "1", default-features = false, features = ["unstable"] }
rustls = { version = "0.21" }
scopeguard = { version = "1" }
winapi = { version = "0.3", default-features = false, features = ["basetsd", "cfg", "combaseapi", "consoleapi", "errhandlingapi", "evntrace", "fileapi", "handleapi", "heapapi", "ifdef", "in6addr", "inaddr", "ioapiset", "iphlpapi", "lmaccess", "lmapibuf", "lmcons", "memoryapi", "minwinbase", "minwindef", "netioapi", "ntlsa", "ntsecapi", "objidl", "oleauto", "pdh", "powerbase", "processenv", "psapi", "rpcdce", "sddl", "securitybaseapi", "shellapi", "std", "stringapiset", "synchapi", "sysinfoapi", "timezoneapi", "wbemcli", "winbase", "wincon", "windef", "winerror", "winioctl", "winnt", "winsock2", "winuser", "ws2ipdef", "ws2tcpip", "wtypesbase"] }
winapi = { version = "0.3", default-features = false, features = ["basetsd", "cfg", "combaseapi", "consoleapi", "errhandlingapi", "evntrace", "fileapi", "handleapi", "heapapi", "ifdef", "in6addr", "inaddr", "ioapiset", "iphlpapi", "lmaccess", "lmapibuf", "lmcons", "memoryapi", "minwinbase", "minwindef", "netioapi", "ntlsa", "ntsecapi", "objidl", "oleauto", "pdh", "powerbase", "processenv", "psapi", "rpcdce", "sddl", "securitybaseapi", "shellapi", "std", "stringapiset", "synchapi", "sysinfoapi", "wbemcli", "winbase", "wincon", "windef", "winerror", "winioctl", "winnt", "winsock2", "winuser", "ws2ipdef", "ws2tcpip", "wtypesbase"] }
windows-sys = { version = "0.48", features = ["Win32_Foundation", "Win32_Networking_WinSock", "Win32_Security", "Win32_Storage_FileSystem", "Win32_System_Console", "Win32_System_Diagnostics_Debug", "Win32_System_IO", "Win32_System_Pipes", "Win32_System_Registry", "Win32_System_SystemServices", "Win32_System_Threading", "Win32_System_Time", "Win32_System_WindowsProgramming", "Win32_UI_Shell"] }
### END HAKARI SECTION