-
Notifications
You must be signed in to change notification settings - Fork 555
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
Add quarter (%q) date string specifier #1666
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1666 +/- ##
=======================================
Coverage 91.05% 91.05%
=======================================
Files 37 37
Lines 17359 17402 +43
=======================================
+ Hits 15806 15846 +40
- Misses 1553 1556 +3 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Please squash any further changes into your original commit.)
GNU date supports %q as a date string specifier. This adds support for that in chrono. This is needed by uutils/coreutils for compability.
373a64b
to
d522b4b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mostly looks okay -- I think this is missing padding? I wouldn't be surprised if someone wanted to parse or format Q1 as Q01
.
Padding isn't missing, since this is a length-1 field. e.g. What is missing though is the length specifier. GNU date support fields like |
Oh, and I'm confused by this:
I did rebase on the lastest |
Thanks for the quick review! |
(Just published 0.4.40 with this change.) |
/// | ||
/// The return value ranges from 1 to 4. | ||
#[inline] | ||
fn quarter(&self) -> u32 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as an FYI this resulted in our arrow-rs builds failing with the latest chrono patch release.
We have codepaths generic on ChronoDateExt + Datelike
and this now results in trait ambiguity.
I don't really know if this counts as a breaking change or not... I feel it shouldn't, but it broke our build so maybe it is?? I don't know...
Edit: The official guidance on semver highlights this as a potential issue but says it is up to maintainers to decide - https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-default-item
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-default-item. In general, with extension traits you're going to be somewhat more likely to be broken, especially if you pick very generic method names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I am a little unsure how best to proceed here, in particular what changes arrow-rs should be making to ensure this doesn't occur again. Other than pinning chrono to a specific patch version, I can't see a tractable way to avoid a reoccurrence?
Switching all callsites to use explicit disambiguation syntax when a chrono trait is in scope is not really a viable option given the extent to which the codebase makes use of traits and generics, and that isn't even considering our downstream consumers...
Maybe it is a case of do nothing now and only do something if it happens again, but I also wonder if chrono might consider not adding new methods to traits in patch releases, especially given how broad its user base is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't worry about it too much, I think this will be relatively rare.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if chrono might consider not adding new methods to traits in patch releases, especially given how broad its user base is?
I'm not sure this is tenable. Unlike arrow which does regular incompatible releases, chrono is firmly entrenched as low-level library for which semver-incompatible bumps are pretty painful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for that, maybe you should figure out some fast-track process for this kind of thing. Honestly a three-day process for little patch releases sounds very last decade to me.
Strong +1.
I understand this is a big ask, but would it be possible to revert this change until a new arrow release is made? We've a very complex codebase spanning multiple repositories & adding and maintaining a Cargo.lock everywhere is really difficult for us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to influence the chrono roadmap feel free to contact me for a commercial arrangement. I'm not going to yank this release because your team is unable to manage Cargo.lock
files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djc why not just yank the release and push this as 0.5.0 like semver conventions would suggest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djc why not just yank the release and push this as 0.5.0 like semver conventions would suggest?
Your understanding of semver conventions as practiced in the crates.io ecosystem seems limited at best, and you seemingly have no idea of the impact of semver-incompatible releases for foundational libraries like chrono. Please take your uninformed "why don't you just" elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly it is for legal reasons...
Hi, it is allowed by the ASF to publish hot fixes without a three-day voting period after a public discussion.
Some new suggestions were adding in 1.85 and they are tripping up CI builds We need to temporarily ignore `useless_conversion` until we're able to upgrade arrow due to rust-lang/rust-clippy#12039 We need to temporarily pin `chrono` until we're able to upgrade arrow due to chronotope/chrono#1666
GNU date supports %q as a date string specifier. This adds support for that in chrono.
This is needed by uutils/coreutils for compability, and would help fix uutils/coreutils#7333.