-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix: handle leap days correctly during timestamp extraction #4878
fix: handle leap days correctly during timestamp extraction #4878
Conversation
@confluentinc It looks like @vinothchandar just signed our Contributor License Agreement. 👍 Always at your service, clabot |
@agavra Would you be able to share your thoughts here..Made a localized fix to get us moving on a production issue.. but there has to be a nicer way to do this prioritization of chrono fields settng order? any other cases that may demand this sort of ordering .. wdyt> ? |
Honestly I'm not totally sure what the implications of this are. I remember adding significant unit testing around this because the behavior was fragile around partial date formats (see #2499). If those tests pass, then I don't see harm in having it done the way you suggest here but again anything with datetime parsing in Java is very brittle. |
@agavra tests seem happy.. We were depending on the ordinal value of these enum and that was making me bit uneasy. Hopefully, that does not get changed over time. I confirmed the sorting holds true . |
That might work, but I feel like the most important thing here is to just have a comprehensive suite of tests and then if anything changes from underneath us we'll be able to at least detect and react |
doing so, fails the tests when
So there the order is not meaningless. Let me think more. |
441542c
to
c07ae73
Compare
@agavra if you are still curious, the ordering might have some trickiness in general.. So I reworked it into a very specific fix: eagerly overriding the year if it's a leap day. |
c07ae73
to
cc2fa14
Compare
fixes confluentinc#4864, in a localized way, added a unit test case
cc2fa14
to
109b0df
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.
Tricky! It still looks good to me. Thanks @vinothchandar
…tinc#4878) fixes confluentinc#4864, in a localized way, added a unit test case
Description
fixes #4864, in a localized way, added a unit test case
Testing done
unit tests, also tested using an end-end example with some sample data containing leap days
Reviewer checklist