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

chore: upgrade chrono to 0.4.38 #17279

Merged
merged 4 commits into from
Jun 17, 2024
Merged

chore: upgrade chrono to 0.4.38 #17279

merged 4 commits into from
Jun 17, 2024

Conversation

hzxa21
Copy link
Collaborator

@hzxa21 hzxa21 commented Jun 17, 2024

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

As titled.

Some methods in NativeDateTime are deprecated in chrono and this PR adopts the new methods accordingly by following chrono's doc.

This currently blocks OpenDAL upgrade (#17198)

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@hzxa21
Copy link
Collaborator Author

hzxa21 commented Jun 17, 2024

Copy paste the doc in chrono 0.4.38 here for references:

    /// Makes a new `NaiveDateTime` corresponding to a UTC date and time,
    /// from the number of non-leap seconds
    /// since the midnight UTC on January 1, 1970 (aka "UNIX timestamp")
    /// and the number of nanoseconds since the last whole non-leap second.
    ///
    /// The nanosecond part can exceed 1,000,000,000 in order to represent a
    /// [leap second](NaiveTime#leap-second-handling), but only when `secs % 60 == 59`.
    /// (The true "UNIX timestamp" cannot represent a leap second unambiguously.)
    ///
    /// # Errors
    ///
    /// Returns `None` if the number of seconds would be out of range for a `NaiveDateTime` (more
    /// than ca. 262,000 years away from common era), and panics on an invalid nanosecond
    /// (2 seconds or more).
    #[deprecated(since = "0.4.35", note = "use `DateTime::from_timestamp` instead")]
    #[inline]
    #[must_use]
    pub const fn from_timestamp_opt(secs: i64, nsecs: u32) -> Option<NaiveDateTime> {
        Some(try_opt!(DateTime::from_timestamp(secs, nsecs)).naive_utc())
    }


    /// Returns the number of non-leap seconds since the midnight on January 1, 1970.
    ///
    /// Note that this does *not* account for the timezone!
    /// The true "UNIX timestamp" would count seconds since the midnight *UTC* on the epoch.
    #[deprecated(since = "0.4.35", note = "use `.and_utc().timestamp()` instead")]
    #[inline]
    #[must_use]
    pub const fn timestamp(&self) -> i64 {
        self.and_utc().timestamp()
    }

    /// Returns the number of non-leap *milliseconds* since midnight on January 1, 1970.
    ///
    /// Note that this does *not* account for the timezone!
    /// The true "UNIX timestamp" would count seconds since the midnight *UTC* on the epoch.
    #[deprecated(since = "0.4.35", note = "use `.and_utc().timestamp_millis()` instead")]
    #[inline]
    #[must_use]
    pub const fn timestamp_millis(&self) -> i64 {
        self.and_utc().timestamp_millis()
    }

Copy link
Member

@fuyufjh fuyufjh left a comment

Choose a reason for hiding this comment

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

Thanks!

@hzxa21 hzxa21 enabled auto-merge June 17, 2024 10:26
@hzxa21 hzxa21 disabled auto-merge June 17, 2024 10:35
@hzxa21 hzxa21 enabled auto-merge June 17, 2024 14:04
@hzxa21 hzxa21 added this pull request to the merge queue Jun 17, 2024
Merged via the queue into main with commit b6f8f46 Jun 17, 2024
30 of 31 checks passed
@hzxa21 hzxa21 deleted the patrick/bump-chrono branch June 17, 2024 15:25
hzxa21 added a commit that referenced this pull request Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants